x86: Align TLB invalidation info
PATCH v3 1/1 x86: Align TLB invalidation info
The TLB invalidation info is allocated on the stack, which might cause it to be unaligned. Since this information may be transferred to different cores for TLB shootdown, this may cause an additional cache line to become shared. While the overhead is likely to be small, the fix is simple.
We do not use __cacheline_aligned() since it also defines the section, which is inappropriate for stack variables.
--
v2 -> v3: rewording the commit message (Andy) v1 -> v2: use __aligned instead of all the mess (Andy)
--- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
@@ -576,7 +576,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, {int cpu; -struct flush_tlb_info info = { +struct flush_tlb_info info__aligned(SMP_CACHE_BYTES) = { .mm = mm, };
Signature · 1 line
2.14.1
tip-bot for Nadav Amit
merge bot[tip:x86/mm] x86/mm: Align TLB invalidation info
x86/mm: Align TLB invalidation info
Commit-ID: 515ab7c41306aad1f80a980e1936ef635c61570c Gitweb: https://git.kernel.org/tip/515ab7c41306aad1f80a980e1936ef635c61570c Author: Nadav Amit <[email protected]> AuthorDate: Wed, 31 Jan 2018 13:19:12 -0800 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 13 Feb 2018 15:05:49 +0100
x86/mm: Align TLB invalidation info
The TLB invalidation info is allocated on the stack, which might cause it to be unaligned. Since this information may be transferred to different cores for TLB shootdown, this may cause an additional cache line to become shared. While the overhead is likely to be small, the fix is simple.
We do not use __cacheline_aligned() since it also defines the section, which is inappropriate for stack variables.
--- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
@@ -613,7 +613,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, {int cpu; -struct flush_tlb_info info = { +struct flush_tlb_info info__aligned(SMP_CACHE_BYTES) = { .mm = mm, };