From 66a3231294db21599b44a8f6e157f4d0ea72c86a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 15 Feb 2023 09:55:00 +0100 Subject: pmap: Do not send TLB flush IPI when a cpu is idle MARK_CPU_ACTIVE already knows to flush TLB when a cpu comes out of idle. However, add memory barriers to be sure that setting cpu_update_needed is seen before testing for cpus_idle. --- i386/intel/pmap.c | 3 ++- i386/intel/pmap.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index fa5bcc3c..129e600b 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -3013,7 +3013,8 @@ void signal_cpus( cpu_update_needed[which_cpu] = TRUE; simple_unlock(&update_list_p->lock); - if (((cpus_idle & (1 << which_cpu)) == 0) || (pmap == kernel_pmap)) + __sync_synchronize(); + if (((cpus_idle & (1 << which_cpu)) == 0)) interrupt_processor(which_cpu); use_list &= ~(1 << which_cpu); } diff --git a/i386/intel/pmap.h b/i386/intel/pmap.h index 78d27bc8..68784ac9 100644 --- a/i386/intel/pmap.h +++ b/i386/intel/pmap.h @@ -424,6 +424,7 @@ pt_entry_t *pmap_pte(const pmap_t pmap, vm_offset_t addr); * interrupt if this happens. \ */ \ i_bit_clear((my_cpu), &cpus_idle); \ + __sync_synchronize(); \ \ if (cpu_update_needed[(my_cpu)]) \ pmap_update_interrupt(); \ -- cgit v1.2.3