Skip to content

add extent status tree caching

Theodore Ts'o linux-ext4 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 26 repliesIn review
  2. v1 RFC3 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ext4: refactor code to read the extent tree blockfs/ext4/extents.c+43 -540 replies
2/5ext4: print the block number of invalid extent tree blocksfs/ext4/extents.c+12 -121 reply
3/5ext4: use unsigned int for es_status valuesfs/ext4/extents_status.c fs/ext4/extents_status.h fs/ext4/inode.c +1 more+40 -330 replies
4/5ext4: cache all of an extent tree's leaf block upon readingfs/ext4/ext4.h fs/ext4/extents.c fs/ext4/extents_status.c +4 more+127 -320 replies
5/5ext4: add new ioctl EXT4_IOC_PRECACHE_EXTENTSfs/ext4/ext4.h fs/ext4/extents.c fs/ext4/extents_status.c +1 more+93 -134 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchZheng Liu
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 0/5 v2] add extent status tree caching

In addition to fixing a few bugs and addressing review comments, we now add a new ioctl, EXT4_IOC_PRECACHE_EXTENTS, which forces all of the extents in an inode to be cached in the extents status tree, and marks them to be preferentially protected when under memory pressure.

This is critically important when using AIO to a preallocated file, since if we need to read in blocks from the extent tree, the io_submit(2) system call becomes synchronous, which is rather rude to applications which were expecting the AIO to be "A".

As a bonus, using the extent status tree to store the logical to physical block mapping is usually more compact that having to keep one or more extent tree blocks in the buffer cache.

(Should we do this all the time, instead of when the application explicitly requests it? Maybe; there could be cases with very large, fragmented files accessed by an application such as "file" is only needs to look at a small subset of the file where this could result in an unnecessary work and memory allocated. OTOH, 95%+ of the time this would probably be a win...)

Theodore Ts'o (5):
ext4: refactor code to read the extent tree block
ext4: print the block number of invalid extent tree blocks
ext4: use unsigned int for es_status values
ext4: cache all of an extent tree's leaf block upon reading
ext4: add new ioctl EXT4_IOC_PRECACHE_EXTENTS

 fs/ext4/ext4.h              |  19 +++-
 fs/ext4/extents.c           | 259 +++++++++++++++++++++++++++++---------------
 fs/ext4/extents_status.c    |  52 ++++++++-
 fs/ext4/extents_status.h    |  50 +++++----
 fs/ext4/inode.c             |   6 +-
 fs/ext4/ioctl.c             |   3 +
 fs/ext4/migrate.c           |   2 +-
 fs/ext4/move_extent.c       |   2 +-
 include/trace/events/ext4.h |  28 +++--
 9 files changed, 296 insertions(+), 125 deletions(-)
Signature · 1 line
1.7.12.rc0.22.gcdd159b