<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/sbitmap.c, branch v5.15.141</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.141</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.141'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-07-08T18:48:20Z</updated>
<entry>
<title>lib: fix spelling mistakes</title>
<updated>2021-07-08T18:48:20Z</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-07-08T01:07:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75'/>
<id>urn:sha1:9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75</id>
<content type='text'>
Fix some spelling mistakes in comments:
permanentely ==&gt; permanently
wont ==&gt; won't
remaning ==&gt; remaining
succed ==&gt; succeed
shouldnt ==&gt; shouldn't
alpha-numeric ==&gt; alphanumeric
storeing ==&gt; storing
funtion ==&gt; function
documenation ==&gt; documentation
Determin ==&gt; Determine
intepreted ==&gt; interpreted
ammount ==&gt; amount
obious ==&gt; obvious
interupts ==&gt; interrupts
occured ==&gt; occurred
asssociated ==&gt; associated
taking into acount ==&gt; taking into account
squence ==&gt; sequence
stil ==&gt; still
contiguos ==&gt; contiguous
matchs ==&gt; matches

Link: https://lkml.kernel.org/r/20210607072555.12416-1-thunder.leizhen@huawei.com
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>scsi: sbitmap: Add sbitmap_calculate_shift() helper</title>
<updated>2021-03-04T22:36:59Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2021-01-22T02:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2d13b1ea9f4affdaa7af0e0e4a1358d28f80c54f'/>
<id>urn:sha1:2d13b1ea9f4affdaa7af0e0e4a1358d28f80c54f</id>
<content type='text'>
Move code for calculating default shift into a public helper which can be
used by SCSI.

Link: https://lore.kernel.org/r/20210122023317.687987-7-ming.lei@redhat.com
Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Kashyap Desai &lt;kashyap.desai@broadcom.com&gt;
Cc: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Tested-by: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sbitmap: Export sbitmap_weight</title>
<updated>2021-03-04T22:36:59Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2021-01-22T02:33:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cbb9950b41dd9dfb7c2be3429ba09f83b8b1ff98'/>
<id>urn:sha1:cbb9950b41dd9dfb7c2be3429ba09f83b8b1ff98</id>
<content type='text'>
SCSI's .device_busy will be converted to sbitmap and sbitmap_weight is
needed. Export the helper.

The only existing user of sbitmap_weight() uses it to find out how many
bits are set and not cleared. Align sbitmap_weight() meaning with this
usage model.

Link: https://lore.kernel.org/r/20210122023317.687987-6-ming.lei@redhat.com
Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Kashyap Desai &lt;kashyap.desai@broadcom.com&gt;
Cc: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Tested-by: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sbitmap: Move allocation hint into sbitmap</title>
<updated>2021-03-04T22:36:59Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2021-01-22T02:33:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c548e62bcf6adc7066ff201e9ecc88e536dd8890'/>
<id>urn:sha1:c548e62bcf6adc7066ff201e9ecc88e536dd8890</id>
<content type='text'>
Allocation hint should have belonged to sbitmap. Also, when sbitmap's depth
is high and there is no need to use mulitple wakeup queues, user can
benefit from percpu allocation hint too.

Move allocation hint into sbitmap, then SCSI device queue can benefit from
allocation hint when converting to plain sbitmap.

Convert vhost/scsi.c to use sbitmap allocation with percpu alloc hint. This
is more efficient than the previous approach.

Link: https://lore.kernel.org/r/20210122023317.687987-5-ming.lei@redhat.com
Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Kashyap Desai &lt;kashyap.desai@broadcom.com&gt;
Cc: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Cc: Mike Christie &lt;michael.christie@oracle.com&gt;
Cc: virtualization@lists.linux-foundation.org
Tested-by: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sbitmap: Add helpers for updating allocation hint</title>
<updated>2021-03-04T22:36:59Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2021-01-22T02:33:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf2c4282a10a92810ba83e85677a5273d6ca0df5'/>
<id>urn:sha1:bf2c4282a10a92810ba83e85677a5273d6ca0df5</id>
<content type='text'>
Add helpers for updating allocation hint so that we can avoid duplicate
code.

Prepare for moving allocation hint into sbitmap.

Link: https://lore.kernel.org/r/20210122023317.687987-4-ming.lei@redhat.com
Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Kashyap Desai &lt;kashyap.desai@broadcom.com&gt;
Cc: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Tested-by: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: sbitmap: Maintain allocation round_robin in sbitmap</title>
<updated>2021-03-04T22:36:59Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2021-01-22T02:33:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=efe1f3a1d5833c0ddd61ee50dbef8908f65a0a5e'/>
<id>urn:sha1:efe1f3a1d5833c0ddd61ee50dbef8908f65a0a5e</id>
<content type='text'>
Currently the allocation round_robin info is maintained by sbitmap_queue.

However, bit allocation really belongs to sbitmap. Move it there.

Link: https://lore.kernel.org/r/20210122023317.687987-3-ming.lei@redhat.com
Cc: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Kashyap Desai &lt;kashyap.desai@broadcom.com&gt;
Cc: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: virtualization@lists.linux-foundation.org
Tested-by: Sumanesh Samanta &lt;sumanesh.samanta@broadcom.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>sbitmap: simplify wrap check</title>
<updated>2020-12-08T00:12:49Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2020-11-22T15:35:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0eff1f1a38a95b20fec83d0b69409c8da967fe1e'/>
<id>urn:sha1:0eff1f1a38a95b20fec83d0b69409c8da967fe1e</id>
<content type='text'>
__sbitmap_get_word() doesn't warp if it's starting from the beginning
(i.e. initial hint is 0). Instead of stashing the original hint just set
@wrap accordingly.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>sbitmap: replace CAS with atomic and</title>
<updated>2020-12-08T00:12:49Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2020-11-22T15:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c3250c8d2451ffbea14ba95164c59edd943ee4be'/>
<id>urn:sha1:c3250c8d2451ffbea14ba95164c59edd943ee4be</id>
<content type='text'>
sbitmap_deferred_clear() does CAS loop to propagate cleared bits,
replace it with equivalent atomic bitwise and. That's slightly faster
and makes wait-free instead of lock-free as before.

The atomic can be relaxed (i.e. barrier-less) because following
sbitmap_get*() deal with synchronisation, see comments in
sbitmap_queue_clear().

It's ok to cast to atomic_long_t, that's what bitops/lock.h does.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>sbitmap: remove swap_lock</title>
<updated>2020-12-08T00:12:49Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2020-11-22T15:35:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=661d4f55a79483aee4970a76e3bd9d4cdc74ac79'/>
<id>urn:sha1:661d4f55a79483aee4970a76e3bd9d4cdc74ac79</id>
<content type='text'>
map-&gt;swap_lock protects map-&gt;cleared from concurrent modification,
however sbitmap_deferred_clear() is already atomically drains it, so
it's guaranteed to not loose bits on concurrent
sbitmap_deferred_clear().

A one threaded tag heavy test on top of nullbk showed ~1.5% t-put
increase, and 3% -&gt; 1% cycle reduction of sbitmap_get() according to perf.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>sbitmap: optimise sbitmap_deferred_clear()</title>
<updated>2020-12-08T00:12:49Z</updated>
<author>
<name>Pavel Begunkov</name>
<email>asml.silence@gmail.com</email>
</author>
<published>2020-11-22T15:35:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b78beea038a3087df63bba7adaacb476a8ca95af'/>
<id>urn:sha1:b78beea038a3087df63bba7adaacb476a8ca95af</id>
<content type='text'>
Because of spinlocks and atomics sbitmap_deferred_clear() have to reload
&amp;sb-&gt;map[index] on each access even though the map address won't change.
Pass in sbitmap_word instead of {sb, index}, so it's cached in a
variable. It also improves code generation of
sbitmap_find_bit_in_index().

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
