drm/i915/gtt: Relax assertion for pt_used

When inserting the final level PTE, we check that we are not overflowing
the page table (checking that pt_used does not exceed the size of the
table). However, we have to allow for every other PTE to be pinned by a
simultaneous removal thread (as on remove we bump the pt_used counter
before adjusting the table).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190821042044.7354-1-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson 2019-08-21 05:20:44 +01:00
parent 4eaceea3a0
commit ff17501013

View File

@ -1110,7 +1110,8 @@ static int __gen8_ppgtt_alloc(struct i915_address_space * const vm,
atomic_read(&pt->used)); atomic_read(&pt->used));
atomic_add(count, &pt->used); atomic_add(count, &pt->used);
GEM_BUG_ON(atomic_read(&pt->used) > I915_PDES); /* All other pdes may be simultaneously removed */
GEM_BUG_ON(atomic_read(&pt->used) > 2 * I915_PDES);
*start += count; *start += count;
} }
} while (idx++, --len); } while (idx++, --len);