From 8982de2eb4fa2fa6f5a350c348c211542aecfaa1 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 2 Jan 2014 16:32:00 +0100 Subject: kern: make struct kmem_cache fit into two cache lines Previously, the size of struct kmem_cache was 136 bytes, just eight bytes larger than 128 bytes, which is typically two cache lines on today's CPUs. By reducing the size of the name field which holds a human-readable description by eight bytes to 24 bytes, the struct kmem_cache can be made fit into two cache lines. This change should not affect the usefulness of this field. For reference, the length of the largest hard-coded name is 17. * kern/slab.h (KMEM_CACHE_NAME_SIZE): Define to 24. --- kern/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kern') diff --git a/kern/slab.h b/kern/slab.h index b842fb7..a4219c4 100644 --- a/kern/slab.h +++ b/kern/slab.h @@ -149,7 +149,7 @@ typedef void (*kmem_slab_free_fn_t)(vm_offset_t, vm_size_t); /* * Cache name buffer size. */ -#define KMEM_CACHE_NAME_SIZE 32 +#define KMEM_CACHE_NAME_SIZE 24 /* * Cache of objects. -- cgit v1.2.3