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>
This commit is contained in:
committed by
Linus Torvalds
parent
635697c663
commit
83aeeada7c
+1
-1
@@ -393,8 +393,8 @@ struct inodes_stat_t {
|
||||
#include <linux/semaphore.h>
|
||||
#include <linux/fiemap.h>
|
||||
#include <linux/rculist_bl.h>
|
||||
#include <linux/shrinker.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/shrinker.h>
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/prio_tree.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/debug_locks.h>
|
||||
#include <linux/mm_types.h>
|
||||
#include <linux/range.h>
|
||||
|
||||
@@ -35,7 +35,7 @@ struct shrinker {
|
||||
|
||||
/* These are for internal use */
|
||||
struct list_head list;
|
||||
long nr; /* objs pending delete */
|
||||
atomic_long_t nr_in_batch; /* objs pending delete */
|
||||
};
|
||||
#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
|
||||
extern void register_shrinker(struct shrinker *);
|
||||
|
||||
Reference in New Issue
Block a user