]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmscan: fix initial shrinker size handling
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Wed, 16 Nov 2011 23:40:58 +0000 (10:40 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 18 Nov 2011 03:49:39 +0000 (14:49 +1100)
commit3705be0ff12ac2b8651919e8085d4acf7532c5ee
tree26a6d2f14a53012d209d8ee20932dd26889d418c
parent04be1f1e0caefc8422b5d39146b3310d6fea0a5b
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