FROMLIST: mm, drm/i915: Mark pinned shmemfs pages as unevictable

Similar in principle to the treatment of get_user_pages, pages that
i915.ko acquires from shmemfs are not immediately reclaimable and so
should be excluded from the mm accounting and vmscan until they have
been returned to the system via shrink_slab/i915_gem_shrink. By moving
the unreclaimable pages off the inactive anon lru, not only should
vmscan be improved by avoiding walking unreclaimable pages, but the
system should also have a better idea of how much memory it can reclaim
at that moment in time.

Note, however, the interaction with shrink_slab which will move some
mlocked pages back to the inactive anon lru.

Suggested-by: Dave Hansen <>
Signed-off-by: Chris Wilson <>
Cc: Joonas Lahtinen <>
Cc: Matthew Auld <>
Cc: Dave Hansen <>
Cc: "Kirill A . Shutemov" <>
Cc: Andrew Morton <>
Cc: Michal Hocko <>

(backport from
Signed-off-by: Kuo-Hsin Yang <>

TEST=manual test; see bug

Change-Id: I46e27687bee4d8c6e9825123801e78225f4c9d79
Commit-Ready: Vovo Yang <>
Tested-by: Vovo Yang <>
Reviewed-by: St├ęphane Marchesin <>
Reviewed-by: Kristian H. Kristensen <>
2 files changed