Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Dec 2015 17:58:58 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r292787 - stable/10/sys/sparc64/include
Message-ID:  <201512271758.tBRHwwWN038757@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Dec 27 17:58:58 2015
New Revision: 292787
URL: https://svnweb.freebsd.org/changeset/base/292787

Log:
  MFC: r287728
  
  Merge r286374 from x86:
  
  Formally pair store_rel(&smp_started) with load_acq(&smp_started).
  Similarly to x86, this change is mostly a NOP due to the kernel
  being run in total store order.

Modified:
  stable/10/sys/sparc64/include/smp.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/sparc64/include/smp.h
==============================================================================
--- stable/10/sys/sparc64/include/smp.h	Sun Dec 27 17:53:39 2015	(r292786)
+++ stable/10/sys/sparc64/include/smp.h	Sun Dec 27 17:58:58 2015	(r292787)
@@ -47,6 +47,7 @@
 #include <sys/sched.h>
 #include <sys/smp.h>
 
+#include <machine/atomic.h>
 #include <machine/intr_machdep.h>
 #include <machine/tte.h>
 
@@ -143,7 +144,7 @@ ipi_all_but_self(u_int ipi)
 {
 	cpuset_t cpus;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return;
 	cpus = all_cpus;
 	sched_pin();
@@ -158,7 +159,8 @@ static __inline void
 ipi_selected(cpuset_t cpus, u_int ipi)
 {
 
-	if (__predict_false(smp_started == 0 || CPU_EMPTY(&cpus)))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0 ||
+	    CPU_EMPTY(&cpus)))
 		return;
 	mtx_lock_spin(&ipi_mtx);
 	cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi);
@@ -169,7 +171,7 @@ static __inline void
 ipi_cpu(int cpu, u_int ipi)
 {
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return;
 	mtx_lock_spin(&ipi_mtx);
 	cpu_ipi_single(cpu, 0, (u_long)tl_ipi_level, ipi);
@@ -183,7 +185,7 @@ ipi_dcache_page_inval(void *func, vm_pad
 {
 	struct ipi_cache_args *ica;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	ica = &ipi_cache_args;
@@ -200,7 +202,7 @@ ipi_icache_page_inval(void *func, vm_pad
 {
 	struct ipi_cache_args *ica;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	ica = &ipi_cache_args;
@@ -217,7 +219,7 @@ ipi_rd(u_int cpu, void *func, u_long *va
 {
 	struct ipi_rd_args *ira;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	ira = &ipi_rd_args;
@@ -234,7 +236,7 @@ ipi_tlb_context_demap(struct pmap *pm)
 	struct ipi_tlb_args *ita;
 	cpuset_t cpus;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	cpus = pm->pm_active;
@@ -259,7 +261,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o
 	struct ipi_tlb_args *ita;
 	cpuset_t cpus;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	cpus = pm->pm_active;
@@ -284,7 +286,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_
 	struct ipi_tlb_args *ita;
 	cpuset_t cpus;
 
-	if (__predict_false(smp_started == 0))
+	if (__predict_false(atomic_load_acq_int(&smp_started) == 0))
 		return (NULL);
 	sched_pin();
 	cpus = pm->pm_active;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512271758.tBRHwwWN038757>