]> 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, 6 Oct 2011 05:59:41 +0000 (16:59 +1100)
commitfd3c3692bbf6d2302006fae55456c3dc8b2a3ff2
tree5942b805338cc82f8d4589bc1a52879162a3c5dd
parente697eef1c408d353362aea8b1c777c65cabd8cda
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