> -Original Message-
> From: Dexuan Cui
> Sent: Sunday, January 15, 2017 7:12 PM
> To: Long Li ; KY Srinivasan ;
> Haiyang Zhang
> Cc: de...@linuxdriverproject.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] hv: use substraction to update ring buffer ind
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
> Behalf Of Long Li
> Sent: Thursday, January 5, 2017 12:08
> To: KY Srinivasan ; Haiyang Zhang
>
> Cc: de...@linuxdriverproject.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] hv: use substraction
> -Original Message-
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
> Sent: Thursday, January 05, 2017 3:40 AM
> To: Long Li
> Cc: KY Srinivasan ; Haiyang Zhang
> ; de...@linuxdriverproject.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH]
On Thu, Jan 05, 2017 at 02:39:55PM +0300, Dan Carpenter wrote:
> > @@ -179,7 +180,8 @@ static u32 hv_copyfrom_ringbuffer(
> > memcpy(dest, ring_buffer + start_read_offset, destlen);
> >
> > start_read_offset += destlen;
> > - start_read_offset %= ring_buffer_size;
> > + if (start_read
On Wed, Jan 04, 2017 at 08:08:22PM -0800, Long Li wrote:
> From: Long Li
>
> The ring buffer code uses %= to calculate index. For x86/64, %= compiles to
> div, more than 10 times slower than sub.
>
> Replace div with sub for this data heavy code path.
>
> Signed-off-by: Long Li
> ---
> driver
From: Long Li
The ring buffer code uses %= to calculate index. For x86/64, %= compiles to
div, more than 10 times slower than sub.
Replace div with sub for this data heavy code path.
Signed-off-by: Long Li
---
drivers/hv/ring_buffer.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletion
6 matches
Mail list logo