]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
SLUB: Do our own flags based on PG_active and PG_error
authorChristoph Lameter <clameter@sgi.com>
Thu, 17 May 2007 05:10:56 +0000 (22:10 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 17 May 2007 12:23:03 +0000 (05:23 -0700)
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>
mm/slub.c

index ce96d485a88f9883a01f506f41154c58e4561cef..3ca164f339651416515aa6fec9b3f88bd9b98137 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
  *                     the fast path and disables lockless freelists.
  */
 
+#define FROZEN (1 << PG_active)
+
+#ifdef CONFIG_SLUB_DEBUG
+#define SLABDEBUG (1 << PG_error)
+#else
+#define SLABDEBUG 0
+#endif
+
 static inline int SlabFrozen(struct page *page)
 {
-       return PageActive(page);
+       return page->flags & FROZEN;
 }
 
 static inline void SetSlabFrozen(struct page *page)
 {
-       SetPageActive(page);
+       page->flags |= FROZEN;
 }
 
 static inline void ClearSlabFrozen(struct page *page)
 {
-       ClearPageActive(page);
+       page->flags &= ~FROZEN;
 }
 
 static inline int SlabDebug(struct page *page)
 {
-#ifdef CONFIG_SLUB_DEBUG
-       return PageError(page);
-#else
-       return 0;
-#endif
+       return page->flags & SLABDEBUG;
 }
 
 static inline void SetSlabDebug(struct page *page)
 {
-#ifdef CONFIG_SLUB_DEBUG
-       SetPageError(page);
-#endif
+       page->flags |= SLABDEBUG;
 }
 
 static inline void ClearSlabDebug(struct page *page)
 {
-#ifdef CONFIG_SLUB_DEBUG
-       ClearPageError(page);
-#endif
+       page->flags &= ~SLABDEBUG;
 }
 
 /*