]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmscan: fix initial shrinker size handling
authorKonstantin Khlebnikov <khlebnikov@openvz.org>
Fri, 2 Dec 2011 03:06:44 +0000 (14:06 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 6 Dec 2011 03:50:58 +0000 (14:50 +1100)
commite2cb0bd49a67d29284fead671c546ea220a96d4f
tree337c3998c77dda7f475069b8fdc152af304059c8
parenta6a9ce3c4fa62a420bf2fee5ae24fda08e43979f
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