btrfs: no longer hold the extent lock for the entire read
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesIn review
- v13 patches 2 repliesSuperseded
Changes in v2 from the cover letter
- Added Goldwyn's bit to move the extent lock to only cover the part where we look up the extent map, added his Co-developed-by to the patch.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: introduce EXTENT_DIO_LOCKEDfs/ fs/ | +58 | 0 replies | |
| 2/3 | btrfs: take the dio extent lock during O_DIRECT operationsfs/ | +35 | 0 replies | |
| 3/3 | btrfs: do not hold the extent lock for entire readfs/ fs/ fs/ | +29 | 3 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | David Sterba | Goldwyn Rodrigues |
|---|---|---|
| Series | R-b | |
| 1/3 | ||
| 2/3 | ||
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] btrfs: no longer hold the extent lock for the entire read
v1: https://lore.kernel.org/linux-btrfs/[email protected]/
v1->v2:
- Added Goldwyn's bit to move the extent lock to only cover the part where we look up the extent map, added his Co-developed-by to the patch.
-- Original email --
Hello,
One of the biggest obstacles to switching to iomap is that our extent locking is a bit wonky. We've made a lot of progress on the write side to drastically narrow the scope of the extent lock, but the read side is arguably the most problematic in that we hold it until the readpage is completed.
This patch series addresses this by no longer holding the lock for the entire IO. This is safe on the buffered side because we are protected by the page lock and the checks for ordered extents when we start the write.
The direct io side is the more problematic side, since we could now end up with overlapping and concurrent direct writes in direct read ranges. To solve this problem I'm introducing a new extent io bit to do range locking for direct IO. This will work basically the same as the extent lock did before, but only for direct IO. We are saved by the normal inode lock and page cache in the mixed buffered and direct case, so this shouldn't carry the same iomap+locking reloated woes that the extent lock did.
This will also allow us to remove the page fault restrictions in the direct IO case, which will be done in a followup series.
I've run this through the CI and a lot of local testing, I'm keeping it small and targeted because this is a pretty big logical shift for us, so I want to make sure we get good testing on it before I go doing the other larger projects. Thanks,
Josef
Josef Bacik (3):
btrfs: introduce EXTENT_DIO_LOCKED
btrfs: take the dio extent lock during O_DIRECT operations
btrfs: do not hold the extent lock for entire read
fs/btrfs/compression.c | 2 +- fs/btrfs/direct-io.c | 72 +++++++++++++++++++----------- fs/btrfs/extent-io-tree.c | 52 ++++++++++------------ fs/btrfs/extent-io-tree.h | 38 ++++++++++++++-- fs/btrfs/extent_io.c | 94 ++------------------------------------- 5 files changed, 109 insertions(+), 149 deletions(-)
Signature · 1 line
2.43.0