]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
SLUB: Do not use page->mapping
authorChristoph Lameter <clameter@sgi.com>
Tue, 16 Oct 2007 08:26:06 +0000 (01:26 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 16 Oct 2007 16:43:01 +0000 (09:43 -0700)
After moving the lockless_freelist to kmem_cache_cpu we no longer need
page->lockless_freelist. Restructure the use of the struct page fields in
such a way that we never touch the mapping field.

This is turn allows us to remove the special casing of SLUB when determining
the mapping of a page (needed for corner cases of virtual caches machines that
need to flush caches of processors mapping a page).

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>
include/linux/mm.h
include/linux/mm_types.h
mm/slub.c

index 6a68d41444f846bfbc71a9eaa28543b3ef5ad411..292c6862375941e9644a661d90d1ced14d5ae7e2 100644 (file)
@@ -568,10 +568,6 @@ static inline struct address_space *page_mapping(struct page *page)
        VM_BUG_ON(PageSlab(page));
        if (unlikely(PageSwapCache(page)))
                mapping = &swapper_space;
-#ifdef CONFIG_SLUB
-       else if (unlikely(PageSlab(page)))
-               mapping = NULL;
-#endif
        else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
                mapping = NULL;
        return mapping;
index 145b3d053048b1527f47cdbabde5eeb26cc3a15d..0cdc8fbf64310c48c53c61761702c24c2cbdef7c 100644 (file)
@@ -62,13 +62,8 @@ struct page {
 #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
            spinlock_t ptl;
 #endif
-           struct {                    /* SLUB uses */
-               void **lockless_freelist;
-               struct kmem_cache *slab;        /* Pointer to slab */
-           };
-           struct {
-               struct page *first_page;        /* Compound pages */
-           };
+           struct kmem_cache *slab;    /* SLUB: Pointer to slab */
+           struct page *first_page;    /* Compound tail pages */
        };
        union {
                pgoff_t index;          /* Our offset within mapping. */
index 4b8037f14fce317168a52bc328fcd21f71aded87..aa8bb072651b86aa5ea3ffefac8525d30aa1c202 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1127,7 +1127,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
        set_freepointer(s, last, NULL);
 
        page->freelist = start;
-       page->lockless_freelist = NULL;
        page->inuse = 0;
 out:
        if (flags & __GFP_WAIT)
@@ -1153,7 +1152,6 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
                NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
                - pages);
 
-       page->mapping = NULL;
        __free_pages(page, s->order);
 }