From 2744a0b69b2ee4c96e87242720907184a3380c56 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Mon, 28 Aug 2017 22:28:41 +0000 Subject: [PATCH] Drop CACHE_LINE_SIZE to 64 bytes on x86 The actual cache line size has always been 64 bytes. The 128 number arose as an optimization for Core 2 era Intel processors. By default (configurable in BIOS), these CPUs would prefetch adjacent cache lines unintelligently. Newer CPUs prefetch more intelligently. The latest Core 2 era CPU was introduced in September 2008 (Xeon 7400 series, "Dunnington"). If you are still using one of these CPUs, especially in a multi-socket configuration, consider locating the "adjacent cache line prefetch" option in BIOS and disabling it. Reported by: mjg Reviewed by: np Discussed with: jhb Sponsored by: Dell EMC Isilon --- sys/amd64/include/param.h | 2 +- sys/i386/include/param.h | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index a619e3950d63..9fc6ca40649e 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -89,7 +89,7 @@ * CACHE_LINE_SIZE is the compile-time maximum cache line size for an * architecture. It should be used with appropriate caution. */ -#define CACHE_LINE_SHIFT 7 +#define CACHE_LINE_SHIFT 6 #define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) /* Size of the level 1 page table units */ diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h index 6d64434082c1..0801147423b4 100644 --- a/sys/i386/include/param.h +++ b/sys/i386/include/param.h @@ -82,7 +82,7 @@ * CACHE_LINE_SIZE is the compile-time maximum cache line size for an * architecture. It should be used with appropriate caution. */ -#define CACHE_LINE_SHIFT 7 +#define CACHE_LINE_SHIFT 6 #define CACHE_LINE_SIZE (1 << CACHE_LINE_SHIFT) #define PAGE_SHIFT 12 /* LOG2(PAGE_SIZE) */ diff --git a/sys/sys/param.h b/sys/sys/param.h index df5cfda47d51..8a0e82c68b84 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200042 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200043 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,