mbox series

[RFC,v3,00/10] implement containerized syncfs for overlayfs

Message ID 20201108140307.1385745-1-cgxu519@mykernel.net (mailing list archive)
Headers show
Series implement containerized syncfs for overlayfs | expand

Message

Chengguang Xu Nov. 8, 2020, 2:02 p.m. UTC
Current syncfs(2) syscall on overlayfs just calls sync_filesystem()
on upper_sb to synchronize whole dirty inodes in upper filesystem
regardless of the overlay ownership of the inode. In the use case of
container, when multiple containers using the same underlying upper
filesystem, it has some shortcomings as below.

(1) Performance
Synchronization is probably heavy because it actually syncs unnecessary
inodes for target overlayfs.

(2) Interference
Unplanned synchronization will probably impact IO performance of
unrelated container processes on the other overlayfs.

This series try to implement containerized syncfs for overlayfs so that
only sync target dirty upper inodes which are belong to specific overlayfs
instance. By doing this, it is able to reduce cost of synchronization and
will not seriously impact IO performance of unrelated processes.

v1->v2:
- Mark overlayfs' inode dirty itself instead of adding notification
mechanism to vfs inode.

v2->v3:
- Introduce overlayfs' extra syncfs wait list to wait target upper inodes
in ->sync_fs.

Chengguang Xu (10):
  ovl: setup overlayfs' private bdi
  ovl: introduce waiting list for syncfs
  ovl: implement ->writepages operation
  ovl: implement overlayfs' ->evict_inode operation
  ovl: mark overlayfs' inode dirty on modification
  ovl: mark overlayfs' inode dirty on shared mmap
  ovl: implement overlayfs' ->write_inode operation
  ovl: cache dirty overlayfs' inode
  ovl: introduce helper of syncfs writeback inode waiting
  ovl: implement containerized syncfs for overlayfs

 fs/overlayfs/file.c      |   2 +
 fs/overlayfs/inode.c     |  25 ++++++++++
 fs/overlayfs/overlayfs.h |   4 ++
 fs/overlayfs/ovl_entry.h |   5 ++
 fs/overlayfs/super.c     | 104 +++++++++++++++++++++++++++++++++++++--
 fs/overlayfs/util.c      |  14 ++++++
 6 files changed, 150 insertions(+), 4 deletions(-)