[PATCH 2/9] drm: kselftest for drm_mm_reserve_node()

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 9 14:43:02 UTC 2016


On Fri, Dec 09, 2016 at 04:31:50PM +0200, Joonas Lahtinen wrote:
> On pe, 2016-12-09 at 13:08 +0000, Chris Wilson wrote:
> > +static int igt_reserve(void *ignored)
> > +{
> > +	int n, ret;
> > +
> > +	for (n = 1; n < 50; n++) {
> 
> The right amount of loops might be something to discuss.

The looping here is for all power-of-two (+-1 to catch the usual
interesting boundary conditions) upto total size == 1<<63 (a little room
to spare). So these I regard as exercising the likely errors, with the
looping inside being subject to discussion. Certainly also probably nice
to run through with primes as well (though we have a few mersenne primes
in this set, so that's probably overkill).

On top of these we also want to think how much error handling we want
inside drm_mm_node_reserve() and add the broken usage.

> > +		ret = __igt_reserve(8192, (1ull << n) - 1);
> 
> BIT_ULL(n) - 1?

Considered it, but felt calling it BIT was misleading / distraction.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list