io-wq: make buffered file write hashed work map per-ctx
authorJens Axboe <axboe@kernel.dk>
Fri, 19 Feb 2021 19:33:30 +0000 (12:33 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Feb 2021 16:23:47 +0000 (09:23 -0700)
commite941894eae31b52f0fd9bdb3ce20620afa152f45
treed8705880ec0fa73973f5c243b91986ca23e6ad09
parenteb2de9418d56b5e6ebf27bad51dbce3e22ee109b
io-wq: make buffered file write hashed work map per-ctx

Before the io-wq thread change, we maintained a hash work map and lock
per-node per-ring. That wasn't ideal, as we really wanted it to be per
ring. But now that we have per-task workers, the hash map ends up being
just per-task. That'll work just fine for the normal case of having
one task use a ring, but if you share the ring between tasks, then it's
considerably worse than it was before.

Make the hash map per ctx instead, which provides full per-ctx buffered
write serialization on hashed writes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c