summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2017-11-15 17:32:21 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 18:21:01 -0800
commit4fd0b46e898791009b03b2fdd6510044fa8730a6 (patch)
treeef78168cf70327d341eaf9fd07f25683dc869262 /mm
parentd50112edde1d0c621520e53747044009f11c656b (diff)
downloadlinux-4fd0b46e898791009b03b2fdd6510044fa8730a6.tar.gz
linux-4fd0b46e898791009b03b2fdd6510044fa8730a6.tar.bz2
linux-4fd0b46e898791009b03b2fdd6510044fa8730a6.zip
slab, slub, slob: convert slab_flags_t to 32-bit
struct kmem_cache::flags is "unsigned long" which is unnecessary on 64-bit as no flags are defined in the higher bits. Switch the field to 32-bit and save some space on x86_64 until such flags appear: add/remove: 0/0 grow/shrink: 0/107 up/down: 0/-657 (-657) function old new delta sysfs_slab_add 720 719 -1 ... check_object 699 676 -23 [akpm@linux-foundation.org: fix printk warning] Link: http://lkml.kernel.org/r/20171021100635.GA8287@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: Christoph Lameter <cl@linux.com> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c4
-rw-r--r--mm/slub.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 19b1b9f99819..7a5e0888a401 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -252,8 +252,8 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
MAKE_LIST((cachep), (&(ptr)->slabs_free), slabs_free, nodeid); \
} while (0)
-#define CFLGS_OBJFREELIST_SLAB ((slab_flags_t __force)0x40000000UL)
-#define CFLGS_OFF_SLAB ((slab_flags_t __force)0x80000000UL)
+#define CFLGS_OBJFREELIST_SLAB ((slab_flags_t __force)0x40000000U)
+#define CFLGS_OFF_SLAB ((slab_flags_t __force)0x80000000U)
#define OBJFREELIST_SLAB(x) ((x)->flags & CFLGS_OBJFREELIST_SLAB)
#define OFF_SLAB(x) ((x)->flags & CFLGS_OFF_SLAB)
diff --git a/mm/slub.c b/mm/slub.c
index 482d1daa9088..33957fd376ae 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -194,9 +194,9 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s)
/* Internal SLUB flags */
/* Poison object */
-#define __OBJECT_POISON ((slab_flags_t __force)0x80000000UL)
+#define __OBJECT_POISON ((slab_flags_t __force)0x80000000U)
/* Use cmpxchg_double */
-#define __CMPXCHG_DOUBLE ((slab_flags_t __force)0x40000000UL)
+#define __CMPXCHG_DOUBLE ((slab_flags_t __force)0x40000000U)
/*
* Tracking user of a slab.
@@ -3657,7 +3657,7 @@ error:
if (flags & SLAB_PANIC)
panic("Cannot create slab %s size=%lu realsize=%u order=%u offset=%u flags=%lx\n",
s->name, (unsigned long)s->size, s->size,
- oo_order(s->oo), s->offset, flags);
+ oo_order(s->oo), s->offset, (unsigned long)flags);
return -EINVAL;
}