staging: ion: shrink highmem pages on kswapd
staging: ion: shrink highmem pages on kswapd

ION system heap keeps pages in its pool for better performance. When the
system is under memory pressure, slab shrinker calls the callback
registered and then the pages pooled get freed.

When the shrinker is called, it checks gfp_mask and determines whether
the pages from highmem need to be freed or the pages from lowmem.
Usually, slab shrinker is invoked on kswapd context which gfp_mask is
always GFP_KERNEL, so only lowmem pages are released on kswapd context.
This means that highmem pages in the pool are never reclaimed until
direct reclaim occurs. This can be problematic when the page pool holds
excessive amounts of highmem.

For now, the shrinker callback cannot know exactly which zone should be
targeted for reclamation, as enough information are not passed to. Thus,
it makes sense to shrink both lowmem and highmem zone on kswapd context.

Reported-by: Wonseo Choi <e028fe506491d21705b76da80864d6289b5f78cb@samsung.com>
Signed-off-by: Heesub Shin <45471ea77bd08f3d26635f3f5adb40ba41250a2b@samsung.com>
Reviewed-by: Mitchel Humpherys <5070267e141ca308fc855217ddbeaf20e729a7bf@codeaurora.org>
Tested-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs