Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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/163712368225.13692.3419908086400748349@noble.neil.brown.name
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

NeilBrown and committed by
Jan Kara
b831281b a48fc69f

+5 -2
+5 -2
fs/reiserfs/journal.c
··· 951 951 int depth; 952 952 953 953 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); 955 957 reiserfs_write_lock_nested(s, depth); 956 958 } 957 959 ··· 1060 1058 put_bh(tbh) ; 1061 1059 } 1062 1060 } 1063 - atomic_dec(&journal->j_async_throttle); 1061 + if (atomic_dec_and_test(&journal->j_async_throttle)) 1062 + wake_up_var(&journal->j_async_throttle); 1064 1063 1065 1064 for (i = 0; i < (jl->j_len + 1); i++) { 1066 1065 bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) +