From 022897410003183d241b499a0b6afbccce90c88d Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Thu, 11 Oct 2012 13:52:55 +0800 Subject: [PATCH] ktr: Use __cachealign to align ktr_cpu The version of __VM_CACHELINE_ALIGN will not properly pad struct to the cache line size. Reviewed-by: dillon@ --- sys/kern/kern_ktr.c | 2 +- sys/sys/ktr.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c index 2963c792d6..8c087022ac 100644 --- a/sys/kern/kern_ktr.c +++ b/sys/kern/kern_ktr.c @@ -164,7 +164,7 @@ SYSCTL_INT(_debug_ktr, OID_AUTO, testspincnt, CTLFLAG_RW, &ktr_testspincnt, 0, " */ 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] } }; diff --git a/sys/sys/ktr.h b/sys/sys/ktr.h index 7b32bee932..d7012bf6ef 100644 --- a/sys/sys/ktr.h +++ b/sys/sys/ktr.h @@ -93,8 +93,7 @@ struct ktr_cpu_core { struct ktr_cpu { struct ktr_cpu_core core; - char pad[__VM_CACHELINE_ALIGN(sizeof(struct ktr_cpu_core))]; -}; +} __cachealign; #ifdef _KERNEL -- 2.41.0