From f2013535956a7e117cad47f86aa45ff6809efccb Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sun, 21 Oct 2012 18:42:05 +0800 Subject: [PATCH] objcache: Make sure that percpu_objcache and depot are cache line aligned Since percpu_objcache and depot are embedded in the objcache, so objcache itself must be cache line aligned. --- sys/kern/kern_objcache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_objcache.c b/sys/kern/kern_objcache.c index 0a36ee63c6..ba6dbc9cdd 100644 --- a/sys/kern/kern_objcache.c +++ b/sys/kern/kern_objcache.c @@ -188,8 +188,9 @@ objcache_create(const char *name, int cluster_limit, int nom_cache, /* * Allocate object cache structure */ - oc = kmalloc(__offsetof(struct objcache, cache_percpu[ncpus]), - M_OBJCACHE, M_WAITOK | M_ZERO); + oc = kmalloc_cachealign( + __offsetof(struct objcache, cache_percpu[ncpus]), + M_OBJCACHE, M_WAITOK | M_ZERO); oc->name = kstrdup(name, M_TEMP); oc->ctor = ctor ? ctor : null_ctor; oc->dtor = dtor ? dtor : null_dtor; -- 2.41.0