]> git.baikalelectronics.ru Git - kernel.git/commit
io-wq: serialize hash clear with wakeup
authorJens Axboe <axboe@kernel.dk>
Fri, 12 Nov 2021 00:32:53 +0000 (17:32 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Nov 2021 00:39:46 +0000 (17:39 -0700)
commitad92fedfa77536dafbfe56f4b49ad2dba3b27bc0
treeb32b5498d47f554f2ebf09558834842b67185d69
parent2e259ec2a3f54201dfcfb8bea591ee5535b13909
io-wq: serialize hash clear with wakeup

We need to ensure that we serialize the stalled and hash bits with the
wait_queue wait handler, or we could be racing with someone modifying
the hashed state after we find it busy, but before we then give up and
wait for it to be cleared. This can cause random delays or stalls when
handling buffered writes for many files, where some of these files cause
hash collisions between the worker threads.

Cc: stable@vger.kernel.org
Reported-by: Daniel Black <daniel@mariadb.org>
Fixes: 2017d6507bc5 ("io-wq: make buffered file write hashed work map per-ctx")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c