ktr: Use __cachealign to align ktr_cpu
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 11 Oct 2012 05:52:55 +0000 (13:52 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 11 Oct 2012 05:52:55 +0000 (13:52 +0800)
The version of __VM_CACHELINE_ALIGN will not properly pad struct to
the cache line size.

Reviewed-by: dillon@
sys/kern/kern_ktr.c
sys/sys/ktr.h

index 2963c79..8c08702 100644 (file)
@@ -164,7 +164,7 @@ SYSCTL_INT(_debug_ktr, OID_AUTO, testspincnt, CTLFLAG_RW, &ktr_testspincnt, 0, "
  */
 static struct  ktr_entry ktr_buf0[KTR_ENTRIES];
 
  */
 static struct  ktr_entry ktr_buf0[KTR_ENTRIES];
 
-__cachealign struct ktr_cpu ktr_cpu[MAXCPU] = {
+struct ktr_cpu ktr_cpu[MAXCPU] = {
        { .core.ktr_buf = &ktr_buf0[0] }
 };
 
        { .core.ktr_buf = &ktr_buf0[0] }
 };
 
index 7b32bee..d7012bf 100644 (file)
@@ -93,8 +93,7 @@ struct ktr_cpu_core {
 
 struct ktr_cpu {
        struct ktr_cpu_core core;
 
 struct ktr_cpu {
        struct ktr_cpu_core core;
-       char pad[__VM_CACHELINE_ALIGN(sizeof(struct ktr_cpu_core))];
-};
+} __cachealign;
 
 #ifdef _KERNEL
 
 
 #ifdef _KERNEL