]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmscan: fix initial shrinker size handling
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Wed, 5 Oct 2011 00:42:57 +0000 (11:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Oct 2011 06:49:21 +0000 (17:49 +1100)
commitc09b4a9059a8d47349f2a6dfc0fbd1b6df6590a7
tree52dd0f7ffe5cd2c866c2ef4a8dd1925657a34db3
parente4c1f3e19a2f909e60389fabbbd79a10d84715da
vmscan: fix initial shrinker size handling

A shrinker function can return -1, means that it cannot do anything
without a risk of deadlock.  For example prune_super() does this if it
cannot grab a superblock refrence, even if nr_to_scan=0.  Currently we
interpret this -1 as a ULONG_MAX size shrinker and evaluate `total_scan'
according to this.  So the next time around this shrinker can cause really
big pressure.  Let's skip such shrinkers instead.

Also make total_scan signed, otherwise the check (total_scan < 0) below
never works.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c