Commit 64502ac3 authored by Kuo-Hsin Yang's avatar Kuo-Hsin Yang Committed by chrome-bot
Browse files

FROMGIT: drm/gem: Mark pinned pages as unevictable

The gem drivers use shmemfs to allocate backing storage for gem objects.
On Samsung Chromebook Plus, the drm/rockchip driver may call
rockchip_gem_get_pages -> drm_gem_get_pages -> shmem_read_mapping_page
to pin a lot of pages, breaking the page reclaim mechanism and causing
oom-killer invocation.

E.g. when the size of a zone is 3.9 GiB, the inactive_ratio is 5. If
active_anon / inactive_anon < 5 and all pages in the inactive_anon lru
are pinned, page reclaim would keep scanning inactive_anon lru without
reclaiming memory. It breaks page reclaim when the rockchip driver only
pins about 1/6 of the anon lru pages.

Mark these pinned pages as unevictable to avoid the premature oom-killer
invocation. See also similar patch on i915 driver [1].

[1]: https://patchwork.freedesktop.org/patch/msgid/20181106132324.17390-1-chris@chris-wilson.co.uk



Signed-off-by: default avatarKuo-Hsin Yang <vovoy@chromium.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190108074517.209860-1-vovoy@chromium.org
(backport from commit fb4b4927
 git://anongit.freedesktop.org/drm/drm drm-next)

BUG=b:122342863
TEST=build and boot

Change-Id: Ib260c6a964d6dd2bc29eac711933b490c4edb7e3
Reviewed-on: https://chromium-review.googlesource.com/1436727


Commit-Ready: Kuo-Hsin Yang <vovoy@chromium.org>
Tested-by: default avatarKuo-Hsin Yang <vovoy@chromium.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
parent 8b2a3152
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment