Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2020 17:18:38 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363399 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <202007211718.06LHIcD9021618@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Jul 21 17:18:38 2020
New Revision: 363399
URL: https://svnweb.freebsd.org/changeset/base/363399

Log:
  Avoid code duplicaiton by using ipi_selected().
  
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Tue Jul 21 16:46:40 2020	(r363398)
+++ head/sys/amd64/amd64/mp_machdep.c	Tue Jul 21 17:18:38 2020	(r363399)
@@ -696,13 +696,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap,
 		CPU_CLR(PCPU_GET(cpuid), &other_cpus);
 	} else {
 		other_cpus = mask;
-		while ((cpu = CPU_FFS(&mask)) != 0) {
-			cpu--;
-			CPU_CLR(cpu, &mask);
-			CTR3(KTR_SMP, "%s: cpu: %d invl ipi op: %x", __func__,
-			    cpu, op);
-			ipi_send_cpu(cpu, IPI_INVLOP);
-		}
+		ipi_selected(mask, IPI_INVLOP);
 	}
 	curcpu_cb(pmap, addr1, addr2);
 	while ((cpu = CPU_FFS(&other_cpus)) != 0) {

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Tue Jul 21 16:46:40 2020	(r363398)
+++ head/sys/i386/i386/mp_machdep.c	Tue Jul 21 17:18:38 2020	(r363399)
@@ -536,13 +536,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector
 		CPU_CLR(PCPU_GET(cpuid), &other_cpus);
 	} else {
 		other_cpus = mask;
-		while ((cpu = CPU_FFS(&mask)) != 0) {
-			cpu--;
-			CPU_CLR(cpu, &mask);
-			CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__,
-			    cpu, vector);
-			ipi_send_cpu(cpu, vector);
-		}
+		ipi_selected(mask, vector);
 	}
 	curcpu_cb(pmap, addr1, addr2);
 	while ((cpu = CPU_FFS(&other_cpus)) != 0) {



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