Skip to content

Commit d92b83f

Browse files
author
Kent Overstreet
committed
bcachefs: bch2_kthread_io_clock_wait() no longer sleeps until full amount
Drop t he loop in bch2_kthread_io_clock_wait(): this allows the code that uses it to be woken up for other reasons, and fixes a bug where rebalance wouldn't wake up when a scan was requested. This raises the possibility of spurious wakeups, but callers should always be able to handle that reasonably well. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 741c1d3 commit d92b83f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/bcachefs/clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
109109
if (cpu_timeout != MAX_SCHEDULE_TIMEOUT)
110110
mod_timer(&wait.cpu_timer, cpu_timeout + jiffies);
111111

112-
while (1) {
112+
do {
113113
set_current_state(TASK_INTERRUPTIBLE);
114114
if (kthread && kthread_should_stop())
115115
break;
@@ -119,7 +119,7 @@ void bch2_kthread_io_clock_wait(struct io_clock *clock,
119119

120120
schedule();
121121
try_to_freeze();
122-
}
122+
} while (0);
123123

124124
__set_current_state(TASK_RUNNING);
125125
del_timer_sync(&wait.cpu_timer);

0 commit comments

Comments
 (0)