From: Omar Sandoval <[email protected]>

This is v3 of the scalable bitmap library derived from blk-mq's tag
allocation code. v1 is here [1], v2 is here [2].

Changes in v3:

- Renamed scale_bitmap to sbitmap

Changes in v2:

- Return -EINVAL instead of BUG_ON() if an invalid shift is passed to
  the initialization functions.
- Rename last_cache to alloc_hint.
- Split the wait queue allocation change into a separate patch. Patch 1
  should now be a no-op.
- Add patches 3 and 4 to make the API cleaner by pushing some context
  from the blk-mq data structures into the common scale_bitmap code.
- Add patch 5 to randomize the allocation hint on initialization like
  was intended originally for blk-mq.

Applies to v4.8-rc5.

1: http://marc.info/?l=linux-block&m=147251402805405
2: http://marc.info/?l=linux-block&m=147329198222482

Omar Sandoval (5):
  blk-mq: abstract tag allocation out into sbitmap library
  sbitmap: allocate wait queues on a specific node
  sbitmap: push per-cpu last_tag into sbitmap_queue
  sbitmap: push alloc policy into sbitmap_queue
  sbitmap: randomize initial last_cache values

 MAINTAINERS             |   1 +
 block/Kconfig           |   1 +
 block/blk-mq-tag.c      | 503 +++++++++++-------------------------------------
 block/blk-mq-tag.h      |  42 ++--
 block/blk-mq.c          | 114 ++++-------
 block/blk-mq.h          |  11 --
 include/linux/blk-mq.h  |   9 +-
 include/linux/sbitmap.h | 379 ++++++++++++++++++++++++++++++++++++
 lib/Kconfig             |   3 +
 lib/Makefile            |   2 +
 lib/sbitmap.c           | 320 ++++++++++++++++++++++++++++++
 11 files changed, 868 insertions(+), 517 deletions(-)
 create mode 100644 include/linux/sbitmap.h
 create mode 100644 lib/sbitmap.c

-- 
2.9.3

Reply via email to