Re: [PATCH 17/17] vsprintf: rework bitmap_list_string

From
Yury Norov <yury.norov@gmail.com>
Date
2021-08-17 16:35:33
Also in
kvm, linux-arch, linux-kselftest, linux-mm, linux-mmc, lkml
Reply to
Andy Shevchenko, 2021-08-15
On Sun, Aug 15, 2021 at 02:09:45PM +0300, Andy Shevchenko wrote:
On Sun, Aug 15, 2021 at 12:21 AM Yury Norov [off-list ref] wrote:
quoted
bitmap_list_string() is very ineffective when printing bitmaps with long
ranges of set bits because it calls find_next_bit for each bit in the
bitmap.  We can do better by detecting ranges of set bits.

In my environment, before/after is 943008/31008 ns.
I would add a couple of words, maybe in parentheses, to describe what
your environment is.

...
quoted
+               buf = number(++buf, end, rtop - 1, default_dec_spec);
++buf is a bit confusing here. Since you will rewrite the buf value
anyway, I would write the parameter as buf + 1.
Agree, it's sloppy. I'll  send the patch by tomorrow.
Thread (26 messages) 26 messages, 3 authors, last reply 2021-08-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help