From 18edd4233e296d59df7c346b4f09517cfb6d6c50 Mon Sep 17 00:00:00 2001 From: David Rientjes Date: Tue, 27 Jan 2009 18:59:46 -0800 Subject: [PATCH] --- yaml --- r: 130792 b: refs/heads/master c: 3718909448116bf4411445468c58acc946379f92 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/slab_def.h | 10 ++++++++-- trunk/mm/slub.c | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 0c9350c989c6..80f80f429b6c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1cf3eb2ff6b0844c678f2f48d0053b9d12b7da67 +refs/heads/master: 3718909448116bf4411445468c58acc946379f92 diff --git a/trunk/include/linux/slab_def.h b/trunk/include/linux/slab_def.h index 6ca6a7b66d75..39c3a5eb8ebe 100644 --- a/trunk/include/linux/slab_def.h +++ b/trunk/include/linux/slab_def.h @@ -43,7 +43,10 @@ static inline void *kmalloc(size_t size, gfp_t flags) i++; #include #undef CACHE - return NULL; + { + extern void __you_cannot_kmalloc_that_much(void); + __you_cannot_kmalloc_that_much(); + } found: #ifdef CONFIG_ZONE_DMA if (flags & GFP_DMA) @@ -74,7 +77,10 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node) i++; #include #undef CACHE - return NULL; + { + extern void __you_cannot_kmalloc_that_much(void); + __you_cannot_kmalloc_that_much(); + } found: #ifdef CONFIG_ZONE_DMA if (flags & GFP_DMA) diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 6392ae5cc6b1..bdc9abb08a23 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -1996,7 +1996,7 @@ static struct kmem_cache_cpu *alloc_kmem_cache_cpu(struct kmem_cache *s, static void free_kmem_cache_cpu(struct kmem_cache_cpu *c, int cpu) { if (c < per_cpu(kmem_cache_cpu, cpu) || - c > per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) { + c >= per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) { kfree(c); return; }