move MACRO SLAB_NEVER_MERGE and SLAB_MERGE_SAME from file mm/slab_common.c to file linux/slab.h. let other kernel code create slab can use these flags. Signed-off-by: Bryton Lee --- include/linux/slab.h | 11 +++++++++++ mm/slab_common.c | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 9a139b6..6853f85 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -90,6 +90,17 @@ /* The following flags affect the page allocator grouping pages by mobility */ #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ + +/* + * Set of flags that will prevent slab merging + */ +#define SLAB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ + SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_NOLEAKTRACE | \ + SLAB_FAILSLAB) + +#define SLAB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \ + SLAB_CACHE_DMA | SLAB_NOTRACK) + /* * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests. * diff --git a/mm/slab_common.c b/mm/slab_common.c index e03dd6f..4f1974b 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -31,16 +31,6 @@ DEFINE_MUTEX(slab_mutex); struct kmem_cache *kmem_cache; /* - * Set of flags that will prevent slab merging - */ -#define SLAB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ - SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_NOLEAKTRACE | \ - SLAB_FAILSLAB) - -#define SLAB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \ - SLAB_CACHE_DMA | SLAB_NOTRACK) - -/* * Merge control. If this is set then no merging of slab caches will occur. * (Could be removed. This was introduced to pacify the merge skeptics.) */ -- 2.0.5 -- Best Regards Bryton.Lee