aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@openvz.org>2011-12-08 17:33:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-09 10:50:27 -0500
commit83aeeada7c69f35e5100b27ec354335597a7a488 (patch)
tree44644e68f303368feba7c8ba3e0e0991d6238ada /include/linux
parent635697c663f38106063d5659f0cf2e45afcd4bb5 (diff)
vmscan: use atomic-long for shrinker batching
Use atomic-long operations instead of looping around cmpxchg(). [akpm@linux-foundation.org: massage atomic.h inclusions] Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Cc: Dave Chinner <david@fromorbit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/shrinker.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 019dc558df1a..e0bc4ffb8e7f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -393,8 +393,8 @@ struct inodes_stat_t {
393#include <linux/semaphore.h> 393#include <linux/semaphore.h>
394#include <linux/fiemap.h> 394#include <linux/fiemap.h>
395#include <linux/rculist_bl.h> 395#include <linux/rculist_bl.h>
396#include <linux/shrinker.h>
397#include <linux/atomic.h> 396#include <linux/atomic.h>
397#include <linux/shrinker.h>
398 398
399#include <asm/byteorder.h> 399#include <asm/byteorder.h>
400 400
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3dc3a8c2c485..4baadd18f4ad 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -10,6 +10,7 @@
10#include <linux/mmzone.h> 10#include <linux/mmzone.h>
11#include <linux/rbtree.h> 11#include <linux/rbtree.h>
12#include <linux/prio_tree.h> 12#include <linux/prio_tree.h>
13#include <linux/atomic.h>
13#include <linux/debug_locks.h> 14#include <linux/debug_locks.h>
14#include <linux/mm_types.h> 15#include <linux/mm_types.h>
15#include <linux/range.h> 16#include <linux/range.h>
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index a83833a1f7a2..07ceb97d53fa 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -35,7 +35,7 @@ struct shrinker {
35 35
36 /* These are for internal use */ 36 /* These are for internal use */
37 struct list_head list; 37 struct list_head list;
38 long nr; /* objs pending delete */ 38 atomic_long_t nr_in_batch; /* objs pending delete */
39}; 39};
40#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ 40#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
41extern void register_shrinker(struct shrinker *); 41extern void register_shrinker(struct shrinker *);