xfs: discontiguous buffer support a.k.a. die xfs_dabuf die
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 17 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | xfs: add trace points for log forcesfs/ fs/ | +18 | 1 reply | |
| 2/10 | xfs: separate buffer indexing from block mapfs/ fs/ | +26 | 4 replies | |
| 3/10 | xfs: convert internal buffer functions to pass mapsfs/ fs/ | +199 | 1 reply | |
| 4/10 | xfs: add discontiguous buffer map interfacefs/ fs/ | +68 | 1 reply | |
| 5/10 | xfs: add discontiguous buffer support to transactionsfs/ fs/ | +79 | 1 reply | |
| 6/10 | xfs: struct xfs_buf_log_format isn't variable sized.fs/ fs/ fs/ +1 more | +34 | 1 reply | |
| 7/10 | xfs: support discontiguous buffers in the xfs_buf_log_itemfs/ fs/ | +247 | 1 reply | |
| 8/10 | xfs: use multiple irec xfs buf support in dabuffs/ fs/ | +239 | 1 reply | |
| 9/10 | xfs: remove struct xfs_dabuf and infrastructurefs/ fs/ fs/ +10 more | +602 | 1 reply | |
| 10/10 | xfs: factor buffer reading from xfs_dir2_leaf_getdentsfs/ | +234 | 1 reply |
Reviews trailers per patch
All 10 patches have a Reviewed-by or Acked-by.
| Patch | Mark Tinguely |
|---|---|
| 1/10 | R-b |
| 2/10 | R-b |
| 3/10 | R-b |
| 4/10 | R-b |
| 5/10 | R-b |
| 6/10 | R-b |
| 7/10 | R-b |
| 8/10 | R-b |
| 9/10 | R-b |
| 10/10 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/10] xfs: discontiguous buffer support a.k.a. die xfs_dabuf die
This patch series builds on top the current patch queue I posted yesterday. This series replaces the struct xfs-dabuf with an xfs_buf that can serve the same purpose.
Directory buffers may be made up of multiple extents, but are currently formed by creating individual buffers and then copying the data out of them into a linear memory region in a dabuf structure. All dabuf operations then require walking all the underlying buffers to change the state of the underlying buffers, and once a dabuf is modified the contents need to be copied back to the underlying buffers before they are logged.
All of these operations can be done on a normal xfs_buf, but the normal xfs_buf does not support multiple disk block ranges or doing multiple disjoint I/Os to read or write a buffer. Supporting multiple disk block ranges is not difficult - we simply need to attach an iovec-like array to the buffer rather than just using a single block number and length.
Splitting the buffer up into multiple IOs for read and write is not difficult, either. We already track the number of IO remaining to complete an IO, so this can be used to wait for the multiple IO dispatched to complete (for both read and write).
The only interesting twist to this is logging the changes. We can treat the discontiguous buffer as a single buffer for most purposes except for formatting the changes into the log. When formatting, we need to split the changes into a format item per underlying region so that recovery does not need to know about compound buffers and can recover each segment of a directory block indivdually as it does now. The fact that recovery will replay all or none of the transaction ensures this process is still atomic from a change recovery point of view.
Further, even though log recovery doesn't use discontiguous buffers, there will be no confusion between a short buffer written by recovery and a discontiguous buffer read by the directory code after mount because the lengths of the buffer will be different. hence we need no changes to mount or log recovery processing as we already ensure that all log recovery changes hve been written to disk before we finish the mount process.
The reason for making this changes is that we can now use a buffer cache callback to do all the metadata CRC calculations and verifications across both contiguous and discontiguous directory blocks. It greatly simplifies the implementation of this code and makes it consistent with all other metadata buffers. It should also provide a performance improvement because it avoids double copying and reduces the number of cached buffers.
I've tested this on 4k/4k (FSB/DB sizes), 512b/64k, and 4k/64k combinations with xfstests and some dbench, fsmark and compilebench stress loads. More testing is welcome....
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs