projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
38fdaec
)
objcache: Make sure that percpu_objcache and depot are cache line aligned
author
Sepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 21 Oct 2012 10:42:05 +0000 (18:42 +0800)
committer
Sepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 21 Oct 2012 10:44:06 +0000 (18:44 +0800)
Since percpu_objcache and depot are embedded in the objcache, so objcache
itself must be cache line aligned.
sys/kern/kern_objcache.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/kern/kern_objcache.c
b/sys/kern/kern_objcache.c
index
0a36ee6
..
ba6dbc9
100644
(file)
--- 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;