OSDN Git Service

drm/mm: add ig_frag selftest
authorNirmoy Das <nirmoy.aiemd@gmail.com>
Fri, 5 Jun 2020 09:14:02 +0000 (11:14 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 8 Jun 2020 13:14:16 +0000 (15:14 +0200)
commit6e60d5ded06baa69cca0b6337053c99b54211624
treed1f84587cd2027172c587c466bca7beb0a0cce25
parenta66da873c424fd9a695ae945d6e0160bb467dcf9
drm/mm: add ig_frag selftest

This patch introduces fragmentation in the address range
and measures time taken by 10k and 20k insertions. ig_frag()
will fail if the time taken by 20k insertions takes more than
4 times of 10k insertions as we know that insertions should at
most scale quadratically.

v2:
introduce fragmentation by freeing every other node.
only test bottom-up and top-down for now.

v3:
fix incorrect mode check

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/369076/
drivers/gpu/drm/selftests/drm_mm_selftests.h
drivers/gpu/drm/selftests/test-drm_mm.c