On 02/03/2026 15:09, Sanjay Yadav wrote:
Add a new kunit test gpu_test_buddy_alloc_range() that exercises the
__gpu_buddy_alloc_range() exact-range allocation path, triggered when
start + size == end with flags=0.

The test covers:
- Basic exact-range allocation of the full mm
- Exact-range allocation of equal sub-ranges (quarters)
- Minimum chunk-size exact ranges at start, middle, and end offsets
- Non power-of-two mm size with multiple roots, including cross-root
   exact-range allocation
- Randomized exact-range allocations of N contiguous page-aligned
   slices in random order
- Negative: partially allocated range must reject overlapping exact
   alloc
- Negative: checkerboard allocation pattern rejects exact range over
   partially occupied pairs
- Negative: misaligned start, unaligned size, and out-of-bounds end
- Free and re-allocate the same exact range across multiple iterations
- Various power-of-two exact ranges at natural alignment

Cc: Christian König <[email protected]>
Cc: Arunpravin Paneer Selvam <[email protected]>
Suggested-by: Matthew Auld <[email protected]>
Signed-off-by: Sanjay Yadav <[email protected]>

Reviewed-by: Matthew Auld <[email protected]>

Reply via email to