[PATCH] mm: slab less atomics
Atomic operation removal from slab Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
5e9dace8d3
commit
f205b2fe62
2 changed files with 5 additions and 7 deletions
|
@ -250,10 +250,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
|
||||||
#define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags)
|
#define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags)
|
||||||
|
|
||||||
#define PageSlab(page) test_bit(PG_slab, &(page)->flags)
|
#define PageSlab(page) test_bit(PG_slab, &(page)->flags)
|
||||||
#define SetPageSlab(page) set_bit(PG_slab, &(page)->flags)
|
#define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags)
|
||||||
#define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags)
|
#define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags)
|
||||||
#define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags)
|
|
||||||
#define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags)
|
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
#define PageHighMem(page) is_highmem(page_zone(page))
|
#define PageHighMem(page) is_highmem(page_zone(page))
|
||||||
|
|
|
@ -1402,7 +1402,7 @@ static void *kmem_getpages(struct kmem_cache *cachep, gfp_t flags, int nodeid)
|
||||||
atomic_add(i, &slab_reclaim_pages);
|
atomic_add(i, &slab_reclaim_pages);
|
||||||
add_page_state(nr_slab, i);
|
add_page_state(nr_slab, i);
|
||||||
while (i--) {
|
while (i--) {
|
||||||
SetPageSlab(page);
|
__SetPageSlab(page);
|
||||||
page++;
|
page++;
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
|
@ -1418,8 +1418,8 @@ static void kmem_freepages(struct kmem_cache *cachep, void *addr)
|
||||||
const unsigned long nr_freed = i;
|
const unsigned long nr_freed = i;
|
||||||
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
if (!TestClearPageSlab(page))
|
BUG_ON(!PageSlab(page));
|
||||||
BUG();
|
__ClearPageSlab(page);
|
||||||
page++;
|
page++;
|
||||||
}
|
}
|
||||||
sub_page_state(nr_slab, nr_freed);
|
sub_page_state(nr_slab, nr_freed);
|
||||||
|
|
Loading…
Reference in a new issue