diff options
| author | Christoph Lameter <clameter@sgi.com> | 2007-05-17 01:10:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-17 08:23:03 -0400 |
| commit | 5577bd8a85c8b7643a241789b14fafa9c8a6c7db (patch) | |
| tree | 0ef0a8adb6811277df3f6e41a2578b1118bc80ef | |
| parent | eefaca9c3246f3daf56e7ed02987f79abcee7087 (diff) | |
SLUB: Do our own flags based on PG_active and PG_error
The atomicity when handling flags in SLUB is not necessary since both flags
used by SLUB are not updated in a racy way. Flag updates are either done
during slab creation or destruction or under slab_lock. Some of these flags
do not have the non atomic variants that we need. So define our own.
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>
| -rw-r--r-- | mm/slub.c | 28 |
1 files changed, 14 insertions, 14 deletions
| @@ -99,42 +99,42 @@ | |||
| 99 | * the fast path and disables lockless freelists. | 99 | * the fast path and disables lockless freelists. |
| 100 | */ | 100 | */ |
| 101 | 101 | ||
| 102 | #define FROZEN (1 << PG_active) | ||
| 103 | |||
| 104 | #ifdef CONFIG_SLUB_DEBUG | ||
| 105 | #define SLABDEBUG (1 << PG_error) | ||
| 106 | #else | ||
| 107 | #define SLABDEBUG 0 | ||
| 108 | #endif | ||
| 109 | |||
| 102 | static inline int SlabFrozen(struct page *page) | 110 | static inline int SlabFrozen(struct page *page) |
| 103 | { | 111 | { |
| 104 | return PageActive(page); | 112 | return page->flags & FROZEN; |
| 105 | } | 113 | } |
| 106 | 114 | ||
| 107 | static inline void SetSlabFrozen(struct page *page) | 115 | static inline void SetSlabFrozen(struct page *page) |
| 108 | { | 116 | { |
| 109 | SetPageActive(page); | 117 | page->flags |= FROZEN; |
| 110 | } | 118 | } |
| 111 | 119 | ||
| 112 | static inline void ClearSlabFrozen(struct page *page) | 120 | static inline void ClearSlabFrozen(struct page *page) |
| 113 | { | 121 | { |
| 114 | ClearPageActive(page); | 122 | page->flags &= ~FROZEN; |
| 115 | } | 123 | } |
| 116 | 124 | ||
| 117 | static inline int SlabDebug(struct page *page) | 125 | static inline int SlabDebug(struct page *page) |
| 118 | { | 126 | { |
| 119 | #ifdef CONFIG_SLUB_DEBUG | 127 | return page->flags & SLABDEBUG; |
| 120 | return PageError(page); | ||
| 121 | #else | ||
| 122 | return 0; | ||
| 123 | #endif | ||
| 124 | } | 128 | } |
| 125 | 129 | ||
| 126 | static inline void SetSlabDebug(struct page *page) | 130 | static inline void SetSlabDebug(struct page *page) |
| 127 | { | 131 | { |
| 128 | #ifdef CONFIG_SLUB_DEBUG | 132 | page->flags |= SLABDEBUG; |
| 129 | SetPageError(page); | ||
| 130 | #endif | ||
| 131 | } | 133 | } |
| 132 | 134 | ||
| 133 | static inline void ClearSlabDebug(struct page *page) | 135 | static inline void ClearSlabDebug(struct page *page) |
| 134 | { | 136 | { |
| 135 | #ifdef CONFIG_SLUB_DEBUG | 137 | page->flags &= ~SLABDEBUG; |
| 136 | ClearPageError(page); | ||
| 137 | #endif | ||
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | /* | 140 | /* |
