diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-09 22:13:30 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-09 22:13:30 +0200 |
commit | 670aee3fc7ac37ae947f8b582d87b51d5fa36524 (patch) | |
tree | 9885998483d4506208e5aef9c13c8a86adea20bb /mm/slab.c | |
parent | d61e87ac53292a3138b4354b687558973686b6ca (diff) | |
parent | 55582bccdc1e89ecc973c260d46e247df675d4df (diff) |
Merge branches 'pm-devfreq' and 'pm-cpufreq'
* pm-devfreq:
PM / devfreq: fix double kfree
PM / devfreq: Fix governor_store()
* pm-cpufreq:
cpufreq: prevent lockup on reading scaling_available_frequencies
cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/slab.c b/mm/slab.c index c77ebe6cc87c..4fcc5dd8d5a6 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2190,9 +2190,16 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) size += BYTES_PER_WORD; } #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC) - if (size >= kmalloc_size(INDEX_NODE + 1) - && cachep->object_size > cache_line_size() - && ALIGN(size, cachep->align) < PAGE_SIZE) { + /* + * To activate debug pagealloc, off-slab management is necessary + * requirement. In early phase of initialization, small sized slab + * doesn't get initialized so it would not be possible. So, we need + * to check size >= 256. It guarantees that all necessary small + * sized slab is initialized in current slab initialization sequence. + */ + if (!slab_early_init && size >= kmalloc_size(INDEX_NODE) && + size >= 256 && cachep->object_size > cache_line_size() && + ALIGN(size, cachep->align) < PAGE_SIZE) { cachep->obj_offset += PAGE_SIZE - ALIGN(size, cachep->align); size = PAGE_SIZE; } |