[Intel-gfx] [PATCH v3 3/3] drm/i915/gtt: Free unused lower-level page tables

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Mon Oct 10 13:39:52 UTC 2016


On pe, 2016-10-07 at 20:39 +0200, Michał Winiarski wrote:
> Since "Dynamic page table allocations" were introduced, our page tables
> can grow (being dynamically allocated) with address space range usage.
> Unfortunately, their lifetime is bound to vm. This is not a huge problem
> when we're not using softpin - drm_mm is creating an upper bound on used
> range by causing addresses for our VMAs to eventually be reused.
> 
> With softpin, long lived contexts can drain the system out of memory
> even with a single "small" object. For example:
> 
> bo = bo_alloc(size);
> while(true)
>     offset += size;
>     exec(bo, offset);
> 
> Will cause us to create new allocations until all memory in the system
> is used for tracking GPU pages (even though almost all PTEs in this vm
> are pointing to scratch).
> 
> Let's free unused page tables in clear_range to prevent this - if no
> entries are used, we can safely free it and return this information to
> the caller (so that higher-level entry is pointing to scratch).
> 
> v2: Document return value and free semantics (Joonas)
> v3: No newlines in vars block (Joonas)
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Michel Thierry <michel.thierry at intel.com>
> Cc: Mika Kuoppala <mika.kuoppala at intel.com>
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Now that we're using Patchwork for CI, better always send the whole
series so that testing catches it properly.

Once the CI results are in and OK, can be merged.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list