| From: |
| Chengguang Xu <cgxu519-AT-mykernel.net> |
| To: |
| miklos-AT-szeredi.hu, jack-AT-suse.cz, amir73il-AT-gmail.com |
| Subject: |
| [RFC PATCH v3 00/10] implement containerized syncfs for overlayfs |
| Date: |
| Sun, 08 Nov 2020 22:02:57 +0800 |
| Message-ID: |
| <20201108140307.1385745-1-cgxu519@mykernel.net> |
| Cc: |
| linux-unionfs-AT-vger.kernel.org, linux-fsdevel-AT-vger.kernel.org, Chengguang Xu <cgxu519-AT-mykernel.net> |
| Archive-link: |
| Article |
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(-)
--
2.26.2