slab.c (1bdd3e05a0a3b4a97ea88bc46fef8fb265c8b94c) | slab.c (8e57f8acbbd121ecfb0c9dc13b8b030f86c6bd3b) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * linux/mm/slab.c 4 * Written by Mark Hemment, 1996/97. 5 * (markhe@nextd.demon.co.uk) 6 * 7 * kmem_cache_destroy() + some cleanup - 1999 Andrea Arcangeli 8 * --- 1402 unchanged lines hidden (view full) --- 1411 cachep = page->slab_cache; 1412 1413 kmem_freepages(cachep, page); 1414} 1415 1416#if DEBUG 1417static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) 1418{ | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * linux/mm/slab.c 4 * Written by Mark Hemment, 1996/97. 5 * (markhe@nextd.demon.co.uk) 6 * 7 * kmem_cache_destroy() + some cleanup - 1999 Andrea Arcangeli 8 * --- 1402 unchanged lines hidden (view full) --- 1411 cachep = page->slab_cache; 1412 1413 kmem_freepages(cachep, page); 1414} 1415 1416#if DEBUG 1417static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) 1418{ |
1419 if (debug_pagealloc_enabled() && OFF_SLAB(cachep) && | 1419 if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && |
1420 (cachep->size % PAGE_SIZE) == 0) 1421 return true; 1422 1423 return false; 1424} 1425 1426#ifdef CONFIG_DEBUG_PAGEALLOC 1427static void slab_kernel_map(struct kmem_cache *cachep, void *objp, int map) --- 575 unchanged lines hidden (view full) --- 2003#if DEBUG 2004 /* 2005 * To activate debug pagealloc, off-slab management is necessary 2006 * requirement. In early phase of initialization, small sized slab 2007 * doesn't get initialized so it would not be possible. So, we need 2008 * to check size >= 256. It guarantees that all necessary small 2009 * sized slab is initialized in current slab initialization sequence. 2010 */ | 1420 (cachep->size % PAGE_SIZE) == 0) 1421 return true; 1422 1423 return false; 1424} 1425 1426#ifdef CONFIG_DEBUG_PAGEALLOC 1427static void slab_kernel_map(struct kmem_cache *cachep, void *objp, int map) --- 575 unchanged lines hidden (view full) --- 2003#if DEBUG 2004 /* 2005 * To activate debug pagealloc, off-slab management is necessary 2006 * requirement. In early phase of initialization, small sized slab 2007 * doesn't get initialized so it would not be possible. So, we need 2008 * to check size >= 256. It guarantees that all necessary small 2009 * sized slab is initialized in current slab initialization sequence. 2010 */ |
2011 if (debug_pagealloc_enabled() && (flags & SLAB_POISON) && | 2011 if (debug_pagealloc_enabled_static() && (flags & SLAB_POISON) && |
2012 size >= 256 && cachep->object_size > cache_line_size()) { 2013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) { 2014 size_t tmp_size = ALIGN(size, PAGE_SIZE); 2015 2016 if (set_off_slab_cache(cachep, tmp_size, flags)) { 2017 flags |= CFLGS_OFF_SLAB; 2018 cachep->obj_offset += tmp_size - size; 2019 size = tmp_size; --- 2212 unchanged lines hidden --- | 2012 size >= 256 && cachep->object_size > cache_line_size()) { 2013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) { 2014 size_t tmp_size = ALIGN(size, PAGE_SIZE); 2015 2016 if (set_off_slab_cache(cachep, tmp_size, flags)) { 2017 flags |= CFLGS_OFF_SLAB; 2018 cachep->obj_offset += tmp_size - size; 2019 size = tmp_size; --- 2212 unchanged lines hidden --- |