summaryrefslogtreecommitdiffstats
path: root/src/ioq.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-01-16 14:19:25 -0500
committerTavian Barnes <tavianator@tavianator.com>2025-01-16 14:19:25 -0500
commit95bc3ed03bf192e3e62278850101fb94d46ab660 (patch)
treed7b17cde6f8fbda4442109ab495fcb96e5757a3e /src/ioq.c
parentf04557374dd37a15842197ce075be600276d341d (diff)
downloadbfs-95bc3ed03bf192e3e62278850101fb94d46ab660.tar.xz
ioq: Don't unroll the spin loop
Diffstat (limited to 'src/ioq.c')
-rw-r--r--src/ioq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ioq.c b/src/ioq.c
index 8050c9e..dd5d31e 100644
--- a/src/ioq.c
+++ b/src/ioq.c
@@ -277,10 +277,13 @@ static struct ioq_monitor *ioq_slot_monitor(struct ioqq *ioqq, ioq_slot *slot) {
/** Atomically wait for a slot to change. */
_noinline
static uintptr_t ioq_slot_wait(struct ioqq *ioqq, ioq_slot *slot, uintptr_t value) {
- // Try spinning a few times before blocking
uintptr_t ret;
+
+ // Try spinning a few times before blocking
+ _nounroll
for (int i = 0; i < 10; ++i) {
// Exponential backoff
+ _nounroll
for (int j = 0; j < (1 << i); ++j) {
spin_loop();
}