mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] bitmap: add bitmap_all_set()/bitmap_all_clear() and use in virtio-mem
@ 2026-12-06 13:52 Alessio Maroni
  2026-12-06 13:52 ` [PATCH 1/2] bitmap: add bitmap_all_set() and bitmap_all_clear() Alessio Maroni
  2026-12-06 13:52 ` [PATCH 2/2] virtio-mem: use " Alessio Maroni
  0 siblings, 2 replies; 3+ messages in thread
From: Alessio Maroni @ 2026-12-06 13:52 UTC (permalink / raw)
  To: Yury Norov, David Hildenbrand, Michael S . Tsirkin
  Cc: Jason Wang, Rasmus Villemoes, Andrew Morton, Eugenio Pérez,
	Xuan Zhuo, virtualization, linux-kernel, Alessio Maroni

This series introduces bitmap_all_set() and bitmap_all_clear() to check
whether all bits in an arbitrary [start, start + nbits) range are set
or clear, and uses them to clean up open-coded find_next_*_bit() checks
in virtio-mem.

Patch 1 adds the two helpers in include/linux/bitmap.h (with compile-time
fast paths for zero, single-bit, and small single-word ranges) along
with selftest coverage in lib/test_bitmap.c.

Patch 2 replaces the manual find_next_zero_bit() / find_next_bit()
expressions in drivers/virtio/virtio_mem.c, resolving the existing TODO
comments.

Tested with lib/test_bitmap selftests (all 454551 tests passed) and
memory hotplug/unplug cycles on QEMU x86_64 with virtio-mem-pci, as
well as W=1 builds and checkpatch.pl --strict.

Alessio Maroni (2):
  bitmap: add bitmap_all_set() and bitmap_all_clear()
  virtio-mem: use bitmap_all_set() and bitmap_all_clear()

 drivers/virtio/virtio_mem.c | 11 ++-------
 include/linux/bitmap.h      | 47 +++++++++++++++++++++++++++++++++++++
 lib/test_bitmap.c           | 38 ++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+), 9 deletions(-)

-- 
2.56.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-06 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-06 13:52 [PATCH 0/2] bitmap: add bitmap_all_set()/bitmap_all_clear() and use in virtio-mem Alessio Maroni
2026-12-06 13:52 ` [PATCH 1/2] bitmap: add bitmap_all_set() and bitmap_all_clear() Alessio Maroni
2026-12-06 13:52 ` [PATCH 2/2] virtio-mem: use " Alessio Maroni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®