mbox series

[0/3] ida: Allow allocations of contiguous IDs

Message ID 20231102153455.1252-1-michal.wajdeczko@intel.com (mailing list archive)
Headers show
Series ida: Allow allocations of contiguous IDs | expand

Message

Michal Wajdeczko Nov. 2, 2023, 3:34 p.m. UTC
Some drivers (like i915) may require allocations of contiguous ranges
of IDs, while current IDA supports only single ID allocation and does
not guarantee that next returned ID will be next to the previous one.

Extend implementation of IDA to allow allocation of arbitrary number
of contiguous IDs and add some basic KUnit test coverage.

Cc: Matthew Wilcox <willy@infradead.org>

Michal Wajdeczko (3):
  ida: Introduce ida_weight()
  ida: Introduce ida_alloc_group_range()
  ida: Add kunit based tests for new IDA functions

 include/linux/idr.h |   4 +
 lib/Kconfig.debug   |  12 +++
 lib/Makefile        |   1 +
 lib/ida_kunit.c     | 140 ++++++++++++++++++++++++++
 lib/idr.c           | 240 +++++++++++++++++++++++++++++++++++---------
 5 files changed, 351 insertions(+), 46 deletions(-)
 create mode 100644 lib/ida_kunit.c