diff options
author | Mark Johnston <markj@FreeBSD.org> | 2021-09-21 15:36:55 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2021-10-18 13:56:58 +0000 |
commit | de8554295b47475e758a573ab7418265f21fee7e (patch) | |
tree | eef60eaa7fdc2ad945c503b62d5c19baa2540dae /sys/i386/i386 | |
parent | 51425cb2107c07ff379639edfbad65c77b55c3b8 (diff) | |
download | src-de8554295b47475e758a573ab7418265f21fee7e.tar.gz src-de8554295b47475e758a573ab7418265f21fee7e.zip |
cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it
This implementation is faster and doesn't modify the cpuset, so it lets
us avoid some unnecessary copying as well. No functional change
intended.
This is a re-application of commit
9068f6ea697b1b28ad1326a4c7a9ba86f08b985e.
Reviewed by: cem, kib, jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32029
Diffstat (limited to 'sys/i386/i386')
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 156702118c45..777aefa021b3 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -598,9 +598,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, ipi_selected(mask, vector); } curcpu_cb(pmap, addr1, addr2); - while ((cpu = CPU_FFS(&other_cpus)) != 0) { - cpu--; - CPU_CLR(cpu, &other_cpus); + CPU_FOREACH_ISSET(cpu, &other_cpus) { p_cpudone = &cpuid_to_pcpu[cpu]->pc_smp_tlb_done; while (*p_cpudone != generation) ia32_pause(); |