[PATCH] drm/gem: Mark pinned pages as unevictable

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 14 10:19:22 UTC 2018


Quoting Kuo-Hsin Yang (2018-12-14 10:09:11)
> On Fri, Dec 14, 2018 at 5:51 PM Chris Wilson <chris at chris-wilson.co.uk> wrote:
> >
> > Quoting Kuo-Hsin Yang (2018-12-14 09:33:19)
> > > On Fri, Dec 14, 2018 at 4:59 PM Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > > >
> > > >
> > > > Do you have a driver in mind (msm?) to demonstrate the use case?
> > >
> > > On Samsung Chromebook Plus, the drm/rockchip driver may call
> > > rockchip_gem_get_pages()/drm_gem_get_pages() to pin a lot of pages,
> > > breaking the page reclaim mechanism and causing oom-killer invocation.
> >
> > Hmm, but this doesn't change the unavailability of the pages, just how
> > much work the shrinker must do scanning the evictable lists containing
> > GEM pages to no avail. So it won't prevent an oom by itself because
> > rockchip will still be holding the pages.
> >
> > Or?
> 
> When the size of a zone is 4GB, the inactive_ratio is 5. If all pages
> in the inactive_anon are pinned and active_anon / inactive_anon < 5,
> page reclaim would only scan inactive_anon due to inactive_ratio. It
> breaks page reclaim when the rockchip driver only pins about 1/6 of
> the anon lru pages. If the pinned pages are marked unevictable, the
> oom-killer would be invoked when anon lru is close to 0.

Ta, I did not know of that relationship. Perfect details for the
changelog to explain how this does improve page reclaim even in the
absence of a GEM shrinker. :)
-Chris


More information about the dri-devel mailing list