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
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
include/linux/mm.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
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>
include/linux/shrinker.h+1−1
@@ -35,7 +35,7 @@ struct shrinker { · 34 unmodified lines
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 *);

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