aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-16 22:10:56 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-17 05:23:03 -0700
commit5577bd8a85c8b7643a241789b14fafa9c8a6c7db (patch)
tree0ef0a8adb6811277df3f6e41a2578b1118bc80ef /mm
parenteefaca9c3246f3daf56e7ed02987f79abcee7087 (diff)
downloadkernel_goldelico_gta04-5577bd8a85c8b7643a241789b14fafa9c8a6c7db.zip
kernel_goldelico_gta04-5577bd8a85c8b7643a241789b14fafa9c8a6c7db.tar.gz
kernel_goldelico_gta04-5577bd8a85c8b7643a241789b14fafa9c8a6c7db.tar.bz2
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')
-rw-r--r--mm/slub.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mm/slub.c b/mm/slub.c
index ce96d48..3ca164f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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;
}
/*