--- include/linux/slub_def.h | 5 ----- mm/slub.c | 30 ------------------------------ 2 files changed, 35 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2007-11-03 14:12:30.427923386 -0700 +++ linux-2.6/mm/slub.c 2007-11-03 14:13:36.597303061 -0700 @@ -242,11 +242,7 @@ static inline struct kmem_cache_node *ge static inline struct kmem_cache_cpu *get_cpu_slab(struct kmem_cache *s, int cpu) { -#ifdef CONFIG_SMP return CPU_PTR(s->cpu_slab, cpu); -#else - return &s->cpu_slab; -#endif } /* @@ -1191,12 +1187,10 @@ static __always_inline unsigned long sla preempt_disable(); state = page->flags & ~LOCKED; -#ifdef CONFIG_SMP if (cmpxchg(&page->flags, state, state | LOCKED) != state) { preempt_enable(); return 0; } -#endif __acquire(bitlock); return state; } @@ -1206,13 +1200,9 @@ static __always_inline unsigned long sla unsigned long state; preempt_disable(); -#ifdef CONFIG_SMP do { state = page->flags & ~LOCKED; } while (cmpxchg(&page->flags, state, state | LOCKED) != state); -#else - state = page->flags & ~LOCKED; -#endif __acquire(bitlock); return state; } @@ -1487,15 +1477,7 @@ static void flush_cpu_slab(void *d) static void flush_all(struct kmem_cache *s) { -#ifdef CONFIG_SMP on_each_cpu(flush_cpu_slab, s, 1, 1); -#else - unsigned long flags; - - local_irq_save(flags); - flush_cpu_slab(s); - local_irq_restore(flags); -#endif } /* @@ -2032,7 +2014,6 @@ static void init_kmem_cache_node(struct #endif } -#ifdef CONFIG_SMP static void free_kmem_cache_cpus(struct kmem_cache *s) { CPU_FREE(s->cpu_slab); @@ -2052,17 +2033,6 @@ static int alloc_kmem_cache_cpus(struct return 1; } -#else -static inline void free_kmem_cache_cpus(struct kmem_cache *s) {} -static inline void init_alloc_cpu(void) {} - -static inline int alloc_kmem_cache_cpus(struct kmem_cache *s, gfp_t flags) -{ - init_kmem_cache_cpu(s, &s->cpu_slab); - return 1; -} -#endif - #ifdef CONFIG_NUMA /* * No kmalloc_node yet so do it by hand. We know that this is the first Index: linux-2.6/include/linux/slub_def.h =================================================================== --- linux-2.6.orig/include/linux/slub_def.h 2007-11-03 14:12:19.945052945 -0700 +++ linux-2.6/include/linux/slub_def.h 2007-11-03 14:13:03.390303248 -0700 @@ -34,12 +34,7 @@ struct kmem_cache_node { * Slab cache management. */ struct kmem_cache { -#ifdef CONFIG_SMP - /* Per cpu pointer usable for any cpu */ struct kmem_cache_cpu *cpu_slab; -#else - struct kmem_cache_cpu cpu_slab; -#endif /* Used for retriving partial slabs etc */ unsigned long flags; int size; /* The size of an object including meta data */