Skip to content

Reduce zonefs memory usage

Damien Le Moal linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7zonefs: Detect append writes at invalid locationsfs/zonefs/super.c+22 -05 replies
2/7zonefs: Reorganize codefs/zonefs/Makefile fs/zonefs/file.c fs/zonefs/super.c +1 more+955 -9161 reply
3/7zonefs: Simplify IO error handlingfs/zonefs/super.c fs/zonefs/zonefs.h+64 -551 reply
4/7zonefs: Reduce struct zonefs_inode_info sizefs/zonefs/file.c fs/zonefs/super.c fs/zonefs/zonefs.h+42 -291 reply
5/7zonefs: Separate zone information from inode informationfs/zonefs/file.c fs/zonefs/super.c fs/zonefs/trace.h +1 more+449 -3041 reply
6/7zonefs: Dynamically create file inodes when neededfs/zonefs/super.c fs/zonefs/zonefs.h+257 -992 replies
7/7zonefs: Cache zone group directory inodesfs/zonefs/super.c fs/zonefs/zonefs.h+49 -01 reply

Reviews trailers per patch

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

PatchJohannes Thumshirn
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

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

Read the v1 thread

Cover letter [PATCH 0/7] Reduce zonefs memory usage

This series improves memory usage by switching to using dynamically allocated inodes and dentries, similarly to regular file systems. This drastically reduces the memory consumption of zonefs when the file system is mounted. E.g., for a 26 TB SMR HDD with over 95000 zones, memory usage is decreased from about 130 MB down to a little over 5 MB.

Since zonefs does not have persistent metadata of its own and relies completely on the device zone state management, information such as the zone write pointer position (used to determine an inode size) is kept in memory at all time, even when an inode is evicted from the inode cache. Dentries can be trivially searched for and created dynamically as needed due to the static file tree structure of a zonefs volume (fully determined by a zoned device zone configuration).

The patch series is organized as follows. Patch 1 fixes a problem with synchronous write error detection and error recovery. Patch 2 reorganizes the code (splitting out file operation code into a new file) and patch 3 simplifies the IO error recovery code. Patch 4 and 5 cleanup inode zone information and split that information out of the zonefs inode structure. Finally, Patch 6 implements dynamic inode and dentry allocation and maanagement operations. Ptch 7 introduces a small optimization to reduce file open latency.

Damien Le Moal (7):
zonefs: Detect append writes at invalid locations
zonefs: Reorganize code
zonefs: Simplify IO error handling
zonefs: Reduce struct zonefs_inode_info size
zonefs: Separate zone information from inode information
zonefs: Dynamically create file inodes when needed
zonefs: Cache zone group directory inodes

 fs/zonefs/Makefile |    2 +-
 fs/zonefs/file.c   |  878 ++++++++++++++++++++
 fs/zonefs/super.c  | 1923 ++++++++++++++++----------------------------
 fs/zonefs/trace.h  |   20 +-
 fs/zonefs/zonefs.h |  110 ++-
 5 files changed, 1684 insertions(+), 1249 deletions(-)
 create mode 100644 fs/zonefs/file.c
Signature · 1 line
2.39.0