mm: vmscan: do not writeback filesystem pages in kswapd except in high priority
mm: vmscan: do not writeback filesystem pages in kswapd except in high priority

It is preferable that no dirty pages are dispatched for cleaning from the
page reclaim path.  At normal priorities, this patch prevents kswapd
writing pages.

However, page reclaim does have a requirement that pages be freed in a
particular zone.  If it is failing to make sufficient progress (reclaiming
< SWAP_CLUSTER_MAX at any priority priority), the priority is raised to
scan more pages.  A priority of DEF_PRIORITY - 3 is considered to be the
point where kswapd is getting into trouble reclaiming pages.  If this
priority is reached, kswapd will dispatch pages for writing.

Signed-off-by: Mel Gorman <39ea6a09710987173e32e37c86918024a0f441c1@suse.de>
Reviewed-by: Minchan Kim <12330474acf818c36105a159b1ab0efedce0665c@gmail.com>
Cc: Dave Chinner <aa743a0aaec8f7d7a1f01442503957f4d7a2d634@fromorbit.com>
Cc: Christoph Hellwig <923f7720577207a44b32e59bbfbea59d27f1ae8e@infradead.org>
Cc: Johannes Weiner <5332d5d6802f0c4180a1f65eb38cf05f0ccdfd97@redhat.com>
Cc: Wu Fengguang <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>
Cc: Jan Kara <596727c8a0ea4db3ba2ceceedccbacd3d7b371b8@suse.cz>
Cc: Rik van Riel <a21938f5d463ddf41aa718934c205ca2cce8ebbc@redhat.com>
Cc: Mel Gorman <39ea6a09710987173e32e37c86918024a0f441c1@suse.de>
Cc: Alex Elder <f556392d917047d964350b9c68912016c96d5e94@sgi.com>
Cc: Theodore Ts'o <4ed386e0495d3e109932df055831d9ec2f824927@mit.edu>
Cc: Chris Mason <a169954b4cb1a46cee25f659d3bddfebe02b5fba@oracle.com>
Cc: Dave Hansen <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas