lkml.org 
[lkml]   [2023]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 1/5] lib/bitmap: add bitmap_{read,write}()
From
On 10/10/2023 11.17, Alexander Potapenko wrote:

>> 'behaves similarly' sounds like an understatement. I think, it behaves
>> much faster because it can assign up to 64 bits at once, not mentioning
>> the pressure on cache lines traffic.
>
> My intent was to describe the visible behavior, of course the
> generated code is better, and the number of memory accesses lower.
>
> How about the following description:
>
> * The result of bitmap_write() is similar to @nbits calls of assign_bit(), i.e.
> * bits beyond @nbits are ignored:
> *
> * for (bit = 0; bit < nbits; bit++)
> * assign_bit(start + bit, bitmap, val & BIT(bit));
>
> ?

C programmers should know the meaning of the term "as-if". Perhaps use
that. Smth like "bitmap_write() behaves as-if implemented as @nbits
calls of __assign_bit()".

Rasmus

\
 
 \ /
  Last update: 2023-10-10 13:04    [W:0.107 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site