1
0
Fork 0

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>
hifive-unleashed-5.1
Christoph Lameter 2007-05-16 22:10:56 -07:00 committed by Linus Torvalds
parent eefaca9c32
commit 5577bd8a85
1 changed files with 14 additions and 14 deletions

View File

@ -99,42 +99,42 @@
* the fast path and disables lockless freelists. * 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) static inline int SlabFrozen(struct page *page)
{ {
return PageActive(page); return page->flags & FROZEN;
} }
static inline void SetSlabFrozen(struct page *page) static inline void SetSlabFrozen(struct page *page)
{ {
SetPageActive(page); page->flags |= FROZEN;
} }
static inline void ClearSlabFrozen(struct page *page) static inline void ClearSlabFrozen(struct page *page)
{ {
ClearPageActive(page); page->flags &= ~FROZEN;
} }
static inline int SlabDebug(struct page *page) static inline int SlabDebug(struct page *page)
{ {
#ifdef CONFIG_SLUB_DEBUG return page->flags & SLABDEBUG;
return PageError(page);
#else
return 0;
#endif
} }
static inline void SetSlabDebug(struct page *page) static inline void SetSlabDebug(struct page *page)
{ {
#ifdef CONFIG_SLUB_DEBUG page->flags |= SLABDEBUG;
SetPageError(page);
#endif
} }
static inline void ClearSlabDebug(struct page *page) static inline void ClearSlabDebug(struct page *page)
{ {
#ifdef CONFIG_SLUB_DEBUG page->flags &= ~SLABDEBUG;
ClearPageError(page);
#endif
} }
/* /*