svn commit: r322989 - in head/sys: amd64/include i386/include sys

Gleb Smirnoff glebius at FreeBSD.org
Tue Aug 29 20:33:34 UTC 2017


  Thanks, Conrad!

  At Netflix we've been running that for several years already. It makes
measurable difference. I'm surprised that FreeBSD has been optimized
by default for a certain short lived generation of CPUs, and everybody
was shy to just make step forward and fix that.

On Mon, Aug 28, 2017 at 10:28:41PM +0000, Conrad Meyer wrote:
C> Author: cem
C> Date: Mon Aug 28 22:28:41 2017
C> New Revision: 322989
C> URL: https://svnweb.freebsd.org/changeset/base/322989
C> 
C> Log:
C>   Drop CACHE_LINE_SIZE to 64 bytes on x86
C>   
C>   The actual cache line size has always been 64 bytes.
C>   
C>   The 128 number arose as an optimization for Core 2 era Intel processors.  By
C>   default (configurable in BIOS), these CPUs would prefetch adjacent cache
C>   lines unintelligently.  Newer CPUs prefetch more intelligently.
C>   
C>   The latest Core 2 era CPU was introduced in September 2008 (Xeon 7400
C>   series, "Dunnington").  If you are still using one of these CPUs, especially
C>   in a multi-socket configuration, consider locating the "adjacent cache line
C>   prefetch" option in BIOS and disabling it.
C>   
C>   Reported by:	mjg
C>   Reviewed by:	np
C>   Discussed with:	jhb
C>   Sponsored by:	Dell EMC Isilon
C> 
C> Modified:
C>   head/sys/amd64/include/param.h
C>   head/sys/i386/include/param.h
C>   head/sys/sys/param.h
C> 
C> Modified: head/sys/amd64/include/param.h
C> ==============================================================================
C> --- head/sys/amd64/include/param.h	Mon Aug 28 22:14:16 2017	(r322988)
C> +++ head/sys/amd64/include/param.h	Mon Aug 28 22:28:41 2017	(r322989)
C> @@ -89,7 +89,7 @@
C>   * CACHE_LINE_SIZE is the compile-time maximum cache line size for an
C>   * architecture.  It should be used with appropriate caution.
C>   */
C> -#define	CACHE_LINE_SHIFT	7
C> +#define	CACHE_LINE_SHIFT	6
C>  #define	CACHE_LINE_SIZE		(1 << CACHE_LINE_SHIFT)
C>  
C>  /* Size of the level 1 page table units */
C> 
C> Modified: head/sys/i386/include/param.h
C> ==============================================================================
C> --- head/sys/i386/include/param.h	Mon Aug 28 22:14:16 2017	(r322988)
C> +++ head/sys/i386/include/param.h	Mon Aug 28 22:28:41 2017	(r322989)
C> @@ -82,7 +82,7 @@
C>   * CACHE_LINE_SIZE is the compile-time maximum cache line size for an
C>   * architecture.  It should be used with appropriate caution.
C>   */
C> -#define	CACHE_LINE_SHIFT	7
C> +#define	CACHE_LINE_SHIFT	6
C>  #define	CACHE_LINE_SIZE		(1 << CACHE_LINE_SHIFT)
C>  
C>  #define PAGE_SHIFT	12		/* LOG2(PAGE_SIZE) */
C> 
C> Modified: head/sys/sys/param.h
C> ==============================================================================
C> --- head/sys/sys/param.h	Mon Aug 28 22:14:16 2017	(r322988)
C> +++ head/sys/sys/param.h	Mon Aug 28 22:28:41 2017	(r322989)
C> @@ -58,7 +58,7 @@
C>   *		in the range 5 to 9.
C>   */
C>  #undef __FreeBSD_version
C> -#define __FreeBSD_version 1200042	/* Master, propagated to newvers */
C> +#define __FreeBSD_version 1200043	/* Master, propagated to newvers */
C>  
C>  /*
C>   * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
C> 

-- 
Totus tuus, Glebius.


More information about the svn-src-head mailing list