summaryrefslogtreecommitdiff
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorFenghua Yu <fenghua.yu@intel.com>2019-09-17 01:39:58 +0300
committerThomas Gleixner <tglx@linutronix.de>2019-11-15 22:20:33 +0300
commitdb8c33f8b5bea59d00ca12dcd6b65d01b1ea98ef (patch)
tree50503cc30093f704159f047d97784e8350bcf56f /arch/x86/kernel
parentf6a892ddd53e555362dbf64d31b47fde0f550ec4 (diff)
downloadlinux-db8c33f8b5bea59d00ca12dcd6b65d01b1ea98ef.tar.xz
x86/cpu: Align the x86_capability array to size of unsigned long
The x86_capability array in cpuinfo_x86 is of type u32 and thus is naturally aligned to 4 bytes. But, set_bit() and clear_bit() require the array to be aligned to size of unsigned long (i.e. 8 bytes on 64-bit systems). The array pointer is handed into atomic bit operations. If the access is not aligned to unsigned long then the atomic bit operations can end up crossing a cache line boundary, which causes the CPU to do a full bus lock as it can't lock both cache lines at once. The bus lock operation is heavy weight and can cause severe performance degradation. The upcoming #AC split lock detection mechanism will issue warnings for this kind of access. Force the alignment of the array to unsigned long. This avoids the massive code changes which would be required when converting the array data type to unsigned long. [ tglx: Rewrote changelog so it contains information WHY this is required ] Suggested-by: David Laight <David.Laight@aculab.com> Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190916223958.27048-4-tony.luck@intel.com
Diffstat (limited to 'arch/x86/kernel')
0 files changed, 0 insertions, 0 deletions