linux/drivers/gpu/tests
Arunpravin Paneer Selvam 4f450f2b0f gpu/tests/buddy: add dirty tracker performance KUnit test
Add gpu_test_buddy_dirty_tracker_performance to demonstrate the key
advantage of the decoupled dirty-tracker design over the old dual-tree
/ force_merge approach.

The test runs two scenarios on a 4 GiB pool after alternating
clear/dirty fragmentation at 4 KiB granularity:

  1. Contiguous 2 GiB alloc: smaller than the 4 GiB span so it routes
     through the contiguous allocator rather than the exact-range fast
     path.  The old design requires __force_merge() to rebuild the
     block; the new design coalesces during free() so the alloc is
     O(log N).

       old (force_merge) - 45 ms
       dirty tracker design - 11 ms

  2. Repeated 256 KiB alloc throughput: the old design pays
     __force_merge() on every alloc; the new design does not.

       old (force_merge) - 86 ms
       dirty tracker design - 20 ms

v2:
 - Force a contiguous 256 KiB allocation in the repeated-alloc loop so
   the baseline actually exercises __force_merge(). (sashiko)

v3:
 - Make the first test allocate 2 GiB instead of the full 4 GiB pool,
   so it really uses the contiguous path; update the numbers. (sashiko)

Assisted-by: Claude:claude-opus-4-8
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20260825172432.80355-2-Arunpravin.PaneerSelvam@amd.com
2026-08-27 17:59:01 +05:30
..
.kunitconfig gpu/tests: Add a dedicated .kunitconfig 2026-07-29 13:06:24 +02:00
gpu_buddy_test.c gpu/tests/buddy: add dirty tracker performance KUnit test 2026-08-27 17:59:01 +05:30
gpu_random.c
gpu_random.h
Makefile