]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmscan: fix initial shrinker size handling
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Wed, 28 Sep 2011 00:50:10 +0000 (10:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 29 Sep 2011 06:08:04 +0000 (16:08 +1000)
commitf98b7d706eff64b3f54afe71a4c78b5cfb43c5a5
treec29101c746401ea379c8d38414015f063bfbb878
parentc0fa4158d3f6183a99a4fd893a57711b98dff91d
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 <>
mm/vmscan.c