SLUB: Do our own flags based on PG_active and PG_error The atomicity of those flags is not really 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. Signed-off-by: Christoph Lameter --- mm/slub.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-15 21:22:25.000000000 -0700 +++ slub/mm/slub.c 2007-05-15 21:25:09.000000000 -0700 @@ -99,42 +99,42 @@ * 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; } /*