aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-17 01:10:56 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-17 08:23:03 -0400
commit5577bd8a85c8b7643a241789b14fafa9c8a6c7db (patch)
tree0ef0a8adb6811277df3f6e41a2578b1118bc80ef /mm/slub.c
parenteefaca9c3246f3daf56e7ed02987f79abcee7087 (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>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mm/slub.c b/mm/slub.c
index ce96d485a88f..3ca164f33965 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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
102static inline int SlabFrozen(struct page *page) 110static inline int SlabFrozen(struct page *page)
103{ 111{
104 return PageActive(page); 112 return page->flags & FROZEN;
105} 113}
106 114
107static inline void SetSlabFrozen(struct page *page) 115static inline void SetSlabFrozen(struct page *page)
108{ 116{
109 SetPageActive(page); 117 page->flags |= FROZEN;
110} 118}
111 119
112static inline void ClearSlabFrozen(struct page *page) 120static inline void ClearSlabFrozen(struct page *page)
113{ 121{
114 ClearPageActive(page); 122 page->flags &= ~FROZEN;
115} 123}
116 124
117static inline int SlabDebug(struct page *page) 125static 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
126static inline void SetSlabDebug(struct page *page) 130static 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
133static inline void ClearSlabDebug(struct page *page) 135static 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/*