diff options
| -rw-r--r-- | mm/slub.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -2435,6 +2435,7 @@ void __init kmem_cache_init(void) | |||
| 2435 | */ | 2435 | */ |
| 2436 | create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", | 2436 | create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node", |
| 2437 | sizeof(struct kmem_cache_node), GFP_KERNEL); | 2437 | sizeof(struct kmem_cache_node), GFP_KERNEL); |
| 2438 | kmalloc_caches[0].refcount = -1; | ||
| 2438 | #endif | 2439 | #endif |
| 2439 | 2440 | ||
| 2440 | /* Able to allocate the per node structures */ | 2441 | /* Able to allocate the per node structures */ |
| @@ -2482,6 +2483,12 @@ static int slab_unmergeable(struct kmem_cache *s) | |||
| 2482 | if (s->ctor) | 2483 | if (s->ctor) |
| 2483 | return 1; | 2484 | return 1; |
| 2484 | 2485 | ||
| 2486 | /* | ||
| 2487 | * We may have set a slab to be unmergeable during bootstrap. | ||
| 2488 | */ | ||
| 2489 | if (s->refcount < 0) | ||
| 2490 | return 1; | ||
| 2491 | |||
| 2485 | return 0; | 2492 | return 0; |
| 2486 | } | 2493 | } |
| 2487 | 2494 | ||
