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@xxxxxxxxxxxxxxxxxx> > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> > Cc: Michel Thierry <michel.thierry@xxxxxxxxx> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> > Signed-off-by: Michał Winiarski <michal.winiarski@xxxxxxxxx> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx