diff options
author | Nick Piggin <npiggin@suse.de> | 2006-03-22 03:08:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:53:57 -0500 |
commit | f205b2fe62d321403525065a4cb31b6bff1bbe53 (patch) | |
tree | 26a2273e7da089e99690097348bf4d35600393f4 | |
parent | 5e9dace8d386def04219134d7160e8a778824764 (diff) |
[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>
-rw-r--r-- | include/linux/page-flags.h | 6 | ||||
-rw-r--r-- | mm/slab.c | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 76c7ffdd0424..8cef69d462f2 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -250,10 +250,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
250 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) | 250 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) |
251 | 251 | ||
252 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 252 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
253 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 253 | #define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags) |
254 | #define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags) | 254 | #define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags) |
255 | #define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags) | ||
256 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | ||
257 | 255 | ||
258 | #ifdef CONFIG_HIGHMEM | 256 | #ifdef CONFIG_HIGHMEM |
259 | #define PageHighMem(page) is_highmem(page_zone(page)) | 257 | #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) | |||
1402 | atomic_add(i, &slab_reclaim_pages); | 1402 | atomic_add(i, &slab_reclaim_pages); |
1403 | add_page_state(nr_slab, i); | 1403 | add_page_state(nr_slab, i); |
1404 | while (i--) { | 1404 | while (i--) { |
1405 | SetPageSlab(page); | 1405 | __SetPageSlab(page); |
1406 | page++; | 1406 | page++; |
1407 | } | 1407 | } |
1408 | return addr; | 1408 | return addr; |
@@ -1418,8 +1418,8 @@ static void kmem_freepages(struct kmem_cache *cachep, void *addr) | |||
1418 | const unsigned long nr_freed = i; | 1418 | const unsigned long nr_freed = i; |
1419 | 1419 | ||
1420 | while (i--) { | 1420 | while (i--) { |
1421 | if (!TestClearPageSlab(page)) | 1421 | BUG_ON(!PageSlab(page)); |
1422 | BUG(); | 1422 | __ClearPageSlab(page); |
1423 | page++; | 1423 | page++; |
1424 | } | 1424 | } |
1425 | sub_page_state(nr_slab, nr_freed); | 1425 | sub_page_state(nr_slab, nr_freed); |