History

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>

Konstantin Khlebnikov committed 14 years ago

Commit 83aeead1 parent 635697c4 files · +10 −12Browse files

Showing the changes to include/linux (3 of 4 files). Show all

Unified · Split

3 files
  1. include/linux/fs.h +1 −1
  2. include/linux/mm.h +1 −0
  3. include/linux/shrinker.h +1 −1
include/linux/fs.h+1−1
@@ -393,8 +393,8 @@ struct inodes_stat_t { · 392 unmodified lines
393393 #include <linux/semaphore.h>
394394 #include <linux/fiemap.h>
395395 #include <linux/rculist_bl.h>
396−#include <linux/shrinker.h>
397396 #include <linux/atomic.h>
397+#include <linux/shrinker.h>
398398
399399 #include <asm/byteorder.h>
400400
include/linux/mm.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/mmzone.h>
1111 #include <linux/rbtree.h>
1212 #include <linux/prio_tree.h>
13+#include <linux/atomic.h>
1314 #include <linux/debug_locks.h>
1415 #include <linux/mm_types.h>
1516 #include <linux/range.h>
include/linux/shrinker.h+1−1
@@ -35,7 +35,7 @@ struct shrinker { · 34 unmodified lines
3535
3636 /* These are for internal use */
3737 struct list_head list;
38− long nr; /* objs pending delete */
38+ atomic_long_t nr_in_batch; /* objs pending delete */
3939 };
4040 #define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
4141 extern void register_shrinker(struct shrinker *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t