summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-microsoft.c
diff options
context:
space:
mode:
authorChris Wilson2015-12-04 16:58:54 +0100
committerDaniel Vetter2016-01-05 11:05:38 +0100
commitc1a415e261aad096b3458ba9157fefd123aa7cbf (patch)
tree18e477c44837e73befe65a37a4356aaf00f17e13 /drivers/hid/hid-microsoft.c
parentmm: Export nr_swap_pages (diff)
downloadkernel-qcow2-linux-c1a415e261aad096b3458ba9157fefd123aa7cbf.tar.gz
kernel-qcow2-linux-c1a415e261aad096b3458ba9157fefd123aa7cbf.tar.xz
kernel-qcow2-linux-c1a415e261aad096b3458ba9157fefd123aa7cbf.zip
drm/i915: Disable shrinker for non-swapped backed objects
If the system has no available swap pages, we cannot make forward progress in the shrinker by releasing active pages, only by releasing purgeable pages which are immediately reaped. Take total_swap_pages into account when counting up available objects to be shrunk and subsequently shrinking them. By doing so, we avoid unbinding objects that cannot be shrunk and so wasting CPU cycles flushing those objects from the GPU to the system and then immediately back again (as they will more than likely be reused shortly after). Based on a patch by Akash Goel. v2: frontswap registers extra swap pages available for the system, so it is already include in the count of available swap pages. v3: Use get_nr_swap_pages() to query the currently available amount of swap space. This should also stop us from shrinking the GPU buffers if we ever run out of swap space. Though at that point, we would expect the oom-notifier to be running and failing miserably... Reported-by: Akash Goel <akash.goel@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: linux-mm@kvack.org Cc: Akash Goel <akash.goel@intel.com> Cc: sourab.gupta@intel.com Link: http://patchwork.freedesktop.org/patch/msgid/1449244734-25733-2-git-send-email-chris@chris-wilson.co.uk Acked-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/hid/hid-microsoft.c')
0 files changed, 0 insertions, 0 deletions