Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Add comment explaining why membar_producer ...



details:   https://anonhg.NetBSD.org/src/rev/f04bf47ecd65
branches:  trunk
changeset: 827420:f04bf47ecd65
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Oct 27 23:22:01 2017 +0000

description:
Add comment explaining why membar_producer is not sfence.

On x86, ordinary non-temporal stores are always issued in program
order to main memory and to other CPUs.

diffstat:

 sys/arch/x86/x86/patch.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r aad0d2e25601 -r f04bf47ecd65 sys/arch/x86/x86/patch.c
--- a/sys/arch/x86/x86/patch.c  Fri Oct 27 19:00:07 2017 +0000
+++ b/sys/arch/x86/x86/patch.c  Fri Oct 27 23:22:01 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: patch.c,v 1.23 2017/10/17 06:58:15 maxv Exp $  */
+/*     $NetBSD: patch.c,v 1.24 2017/10/27 23:22:01 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.23 2017/10/17 06:58:15 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.24 2017/10/27 23:22:01 riastradh Exp $");
 
 #include "opt_lockdebug.h"
 #ifdef i386
@@ -177,7 +177,12 @@
 #endif /* !LOCKDEBUG */
        }
        if (!early && (cpu_feature[0] & CPUID_SSE2) != 0) {
-               /* Faster memory barriers. */
+               /*
+                * Faster memory barriers.  We do not need to patch
+                * membar_producer to use SFENCE because on x86
+                * ordinary non-temporal stores are always issued in
+                * program order to main memory and to other CPUs.
+                */
                patchfunc(
                    sse2_lfence, sse2_lfence_end,
                    membar_consumer, membar_consumer_end,



Home | Main Index | Thread Index | Old Index