diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-15 10:59:42 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-15 10:59:42 +0100 |
commit | ca7b8ae031d9ce12139d96caedc5d1bd369feeca (patch) | |
tree | 5506dc516c95c7f6c065dd0d4e00ee69cd53eb3b /i386 | |
parent | d3ef1ba20f7b6e1af5387c48d58da38cc55d3b79 (diff) | |
download | gnumach-ca7b8ae031d9ce12139d96caedc5d1bd369feeca.tar.gz gnumach-ca7b8ae031d9ce12139d96caedc5d1bd369feeca.tar.bz2 gnumach-ca7b8ae031d9ce12139d96caedc5d1bd369feeca.zip |
smp: Fix more busy loops
We need to avoid the kernel optimizing away the reads from
memory. Use a standard relaxing instruction for that.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/i386/lock.h | 1 | ||||
-rw-r--r-- | i386/intel/pmap.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/i386/i386/lock.h b/i386/i386/lock.h index 4b445ae4..b189a559 100644 --- a/i386/i386/lock.h +++ b/i386/i386/lock.h @@ -30,6 +30,7 @@ #define _I386_LOCK_H_ #if NCPUS > 1 +#include <i386/smp.h> /* * All of the locking routines are built from calls on diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 3b52deb3..3605d120 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -3093,9 +3093,9 @@ void pmap_update_interrupt(void) * Wait for any pmap updates in progress, on either user * or kernel pmap. */ - while (*(volatile int *)&my_pmap->lock.lock_data || - *(volatile int *)&kernel_pmap->lock.lock_data) - continue; + while (my_pmap->lock.lock_data || + kernel_pmap->lock.lock_data) + cpu_pause(); process_pmap_updates(my_pmap); |