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 <dave.hansen@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>

(backport from https://patchwork.kernel.org/patch/9768741/)
Signed-off-by: Kuo-Hsin Yang <vovoy@chromium.org>

BUG=chromium:800237
TEST=manual test; see bug

Change-Id: I46e27687bee4d8c6e9825123801e78225f4c9d79
Reviewed-on: https://chromium-review.googlesource.com/895232
Commit-Ready: Vovo Yang <vovoy@chromium.org>
Tested-by: Vovo Yang <vovoy@chromium.org>
Reviewed-by: St├ęphane Marchesin <marcheu@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2 files changed