]> git.baikalelectronics.ru Git - kernel.git/commit
mm, drm/i915: mark pinned shmemfs pages as unevictable
authorKuo-Hsin Yang <vovoy@chromium.org>
Tue, 6 Nov 2018 13:23:24 +0000 (13:23 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 7 Nov 2018 15:28:32 +0000 (15:28 +0000)
commitde0c05f794f9c75b3b6c59df96f112a7f8959f41
tree7038d1180a6a6bd19db14e92336c602686a3e7df
parent9df41051735b085b18e39b6f310e489ff3b1f06b
mm, drm/i915: mark pinned shmemfs pages as unevictable

The i915 driver uses shmemfs to allocate backing storage for gem
objects. These shmemfs pages can be pinned (increased ref count) by
shmem_read_mapping_page_gfp(). When a lot of pages are pinned, vmscan
wastes a lot of time scanning these pinned pages. In some extreme case,
all pages in the inactive anon lru are pinned, and only the inactive
anon lru is scanned due to inactive_ratio, the system cannot swap and
invokes the oom-killer. Mark these pinned pages as unevictable to speed
up vmscan.

Export pagevec API check_move_unevictable_pages().

This patch was inspired by Chris Wilson's change [1].

[1]: https://patchwork.kernel.org/patch/9768741/

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Kuo-Hsin Yang <vovoy@chromium.org>
Acked-by: Michal Hocko <mhocko@suse.com> # mm part
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20181106132324.17390-1-chris@chris-wilson.co.uk
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Documentation/vm/unevictable-lru.rst
drivers/gpu/drm/i915/i915_gem.c
include/linux/swap.h
mm/shmem.c
mm/vmscan.c