Remove delay loop from spinlock wait.

Now we halt CPU cores that are going to be idle for a lengthy period,
we don't need to try to save power in other ways. And anyway, this was
not very effective.
This commit is contained in:
Martin Whitaker 2022-02-12 19:33:53 +00:00
parent 2bf1623733
commit c23b129e55

View File

@ -22,7 +22,6 @@ static inline void spin_wait(spinlock_t *lock)
if (lock) {
while (*lock) {
__builtin_ia32_pause();
for (volatile int i = 0; i < 100; i++) { } // this reduces power consumption
}
}
}
@ -36,7 +35,6 @@ static inline void spin_lock(spinlock_t *lock)
while (!__sync_bool_compare_and_swap(lock, false, true)) {
do {
__builtin_ia32_pause();
for (volatile int i = 0; i < 100; i++) { } // this reduces power consumption
} while (*lock);
}
__sync_synchronize();