diff options
Diffstat (limited to 'kern/kmem_i.h')
-rw-r--r-- | kern/kmem_i.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kern/kmem_i.h b/kern/kmem_i.h index f1705965..64da686a 100644 --- a/kern/kmem_i.h +++ b/kern/kmem_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2017 Richard Braun. + * Copyright (c) 2010-2018 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,12 @@ #include <kern/mutex.h> #include <machine/cpu.h> +#if defined(CONFIG_SMP) && !defined(CONFIG_KMEM_NO_CPU_LAYER) +#define KMEM_USE_CPU_LAYER +#endif + +#ifdef KMEM_USE_CPU_LAYER + /* * Per-processor cache of pre-constructed objects. * @@ -52,6 +58,8 @@ struct kmem_cpu_pool_type { struct kmem_cache *array_cache; }; +#endif /* KMEM_USE_CPU_LAYER */ + /* * Buffer descriptor. * @@ -169,9 +177,11 @@ struct kmem_slab { * Locking order : cpu_pool -> cache. CPU pools locking is ordered by CPU ID. */ struct kmem_cache { +#ifdef KMEM_USE_CPU_LAYER /* CPU pool layer */ struct kmem_cpu_pool cpu_pools[CONFIG_MAX_CPUS]; struct kmem_cpu_pool_type *cpu_pool_type; +#endif /* KMEM_USE_CPU_LAYER */ /* Slab layer */ struct mutex lock; |