jbd2: Fix leaked transaction credits
Status from this message: Thanks, applied.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 3 repliesApplied
- v12 patches 4 repliesSuperseded
Changes in v2 from the cover letter
* Add reviewed-by tag
* Fixed up one coding style issue pointed out by Andreas
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | ext4: Drop ext4_journal_free_reserved()fs/ | +0 | 2 replies | |
| 2/2 | jbd2: Avoid leaking transaction credits when unreserving handlefs/ | +11 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Andreas Dilger |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2 v2] jbd2: Fix leaked transaction credits
Hello,
after debugging more the reason why fsmark run is slower in dioread_nolock mode (which became the default in 5.6), I've found jbd2 actually leaks reserved credits if we start a transaction with reserved handle and then don't use it. The first patch in the series is a small (and independent) cleanup in the area, the second patch fixes the leak.
Then there was another revelation for me that in this workload ext4 actually starts lots of reserved transaction handles that are unused. This is due to the way how ext4 writepages code works - it starts a transaction, then inspects page cache and writes one extent if found. Then starts again a transaction and checks whether there's more to write. So for single extent files we always start transaction twice, second time only to find there's nothing more to write. In case all blocks are already allocated, we wouldn't even have to start transaction at all. This probably also deserves to be fixed but a simple fix I made seems to break page writeback so I need to dig more into it and I want to push out the obvious jbd2 fix early.
Changes since v1:
* Add reviewed-by tag
* Fixed up one coding style issue pointed out by Andreas
Honza