Skip to content

Commit b831281

Browse files
neilbrownjankara
authored andcommitted
reiserfs: don't use congestion_wait()
Block devices do not, in general, report congestion any more, so this congestion_wait() is effectively just a sleep. It isn't entirely clear what is being waited for, but as we only wait when j_async_throttle is elevated, it seems reasonable to stop waiting when j_async_throttle becomes zero - or after the same timeout. So change to use wait_event_event_timeout() for waiting, and wake_up_var() to signal an end to waiting. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent a48fc69 commit b831281

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/reiserfs/journal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,9 @@ static int reiserfs_async_progress_wait(struct super_block *s)
951951
int depth;
952952

953953
depth = reiserfs_write_unlock_nested(s);
954-
congestion_wait(BLK_RW_ASYNC, HZ / 10);
954+
wait_var_event_timeout(&j->j_async_throttle,
955+
atomic_read(&j->j_async_throttle) == 0,
956+
HZ / 10);
955957
reiserfs_write_lock_nested(s, depth);
956958
}
957959

@@ -1058,7 +1060,8 @@ static int flush_commit_list(struct super_block *s,
10581060
put_bh(tbh) ;
10591061
}
10601062
}
1061-
atomic_dec(&journal->j_async_throttle);
1063+
if (atomic_dec_and_test(&journal->j_async_throttle))
1064+
wake_up_var(&journal->j_async_throttle);
10621065

10631066
for (i = 0; i < (jl->j_len + 1); i++) {
10641067
bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) +

0 commit comments

Comments
 (0)