Skip to content

Commit

Permalink
SLUB: use atomic_long_read for atomic_long variables
Browse files Browse the repository at this point in the history
SLUB is using atomic_read() for variables declared atomic_long_t.
Switch to atomic_long_read().

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Aug 23, 2007
1 parent fe58103 commit 9e86943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3112,7 +3112,7 @@ static int list_locations(struct kmem_cache *s, char *buf,
unsigned long flags;
struct page *page;

if (!atomic_read(&n->nr_slabs))
if (!atomic_long_read(&n->nr_slabs))
continue;

spin_lock_irqsave(&n->list_lock, flags);
Expand Down Expand Up @@ -3247,7 +3247,7 @@ static unsigned long slab_objects(struct kmem_cache *s,
}

if (flags & SO_FULL) {
int full_slabs = atomic_read(&n->nr_slabs)
int full_slabs = atomic_long_read(&n->nr_slabs)
- per_cpu[node]
- n->nr_partial;

Expand Down Expand Up @@ -3283,7 +3283,7 @@ static int any_slab_objects(struct kmem_cache *s)
for_each_node(node) {
struct kmem_cache_node *n = get_node(s, node);

if (n->nr_partial || atomic_read(&n->nr_slabs))
if (n->nr_partial || atomic_long_read(&n->nr_slabs))
return 1;
}
return 0;
Expand Down

0 comments on commit 9e86943

Please sign in to comment.