linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/6] Introduce erofs shared domain
@ 2022-09-14 10:50 Jia Zhu
  2022-09-14 10:50 ` [PATCH V3 1/6] erofs: use kill_anon_super() to kill super in fscache mode Jia Zhu
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Jia Zhu @ 2022-09-14 10:50 UTC (permalink / raw)
  To: linux-erofs, xiang, chao; +Cc: linux-kernel, huyue2, linux-fsdevel, yinxin.x

Changes since V2:
1. Some code cleanups:
   1.1 Optimize the input parameters and return values of some functions.
   1.2 Only reserve a pair of function declarations for fscache related codes.
   1.3 Remove useless null check.
   1.4 Replace some ternary operators to make the code more intuitive.
2. Increase the granularity of @domain->mutex to a global lock.
3. Adjust patchset structure and order.

[Kernel Patchset]
===============
Git tree:
	https://github.com/userzj/linux.git zhujia/shared-domain-v3
Git web:
	https://github.com/userzj/linux/tree/zhujia/shared-domain-v3

[User Daemon for Quick Test]
============================
Git web:
	https://github.com/userzj/demand-read-cachefilesd/tree/shared-domain
More test cases will be added to:
	https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/log/?h=experimental-tests-fscache 

[E2E Container Demo for Quick Test]
===================================
[Issue]
	https://github.com/containerd/nydus-snapshotter/issues/161
[PR]
	https://github.com/containerd/nydus-snapshotter/pull/162

[Background]
============
In ondemand read mode, we use individual volume to present an erofs
mountpoint, cookies to present bootstrap and data blobs.

In which case, since cookies can't be shared between fscache volumes,
even if the data blobs between different mountpoints are exactly same,
they can't be shared.

[Introduction]
==============
Here we introduce erofs shared domain to resolve above mentioned case.
Several erofs filesystems can belong to one domain, and data blobs can
be shared among these erofs filesystems of same domain.

[Usage]
Users could specify 'domain_id' mount option to create or join into a
domain which reuses the same cookies(blobs).

[Design]
========
1. Use pseudo mnt to manage domain's lifecycle.
2. Use a linked list to maintain & traverse domains.
3. Use pseudo sb to create anonymous inode for recording cookie's info
   and manage cookies lifecycle.

[Flow Path]
===========
1. User specify a new 'domain_id' in mount option.
   1.1 Traverse domain list, compare domain_id with existing domain.[Miss]
   1.2 Create a new domain(volume), add it to domain list.
   1.3 Traverse pseudo sb's inode list, compare cookie name with
       existing cookies.[Miss]
   1.4 Alloc new anonymous inodes and cookies.

2. User specify an existing 'domain_id' in mount option and the data
   blob is existed in domain.
   2.1 Traverse domain list, compare domain_id with existing domain.[Hit]
   2.2 Reuse the domain and increase its refcnt.
   2.3 Traverse pseudo sb's inode list, compare cookie name with
   	   existing cookies.[Hit]
   2.4 Reuse the cookie and increase its refcnt.

RFC: https://lore.kernel.org/all/YxAlO%2FDHDrIAafR2@B-P7TQMD6M-0146.local/
V1: https://lore.kernel.org/all/20220902034748.60868-1-zhujia.zj@bytedance.com/
V2: https://lore.kernel.org/all/20220902105305.79687-1-zhujia.zj@bytedance.com/

Jia Zhu (6):
  erofs: use kill_anon_super() to kill super in fscache mode
  erofs: code clean up for fscache
  erofs: introduce 'domain_id' mount option
  erofs: introduce fscache-based domain
  erofs: introduce a pseudo mnt to manage shared cookies
  erofs: Support sharing cookies in the same domain

 fs/erofs/fscache.c  | 252 +++++++++++++++++++++++++++++++++++++++-----
 fs/erofs/internal.h |  30 ++++--
 fs/erofs/super.c    |  72 ++++++++++---
 fs/erofs/sysfs.c    |  19 +++-
 4 files changed, 321 insertions(+), 52 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-09-15  8:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 10:50 [PATCH V3 0/6] Introduce erofs shared domain Jia Zhu
2022-09-14 10:50 ` [PATCH V3 1/6] erofs: use kill_anon_super() to kill super in fscache mode Jia Zhu
2022-09-15  2:28   ` JeffleXu
2022-09-15  6:07     ` [External] " Jia Zhu
2022-09-14 10:50 ` [PATCH V3 2/6] erofs: code clean up for fscache Jia Zhu
2022-09-15  2:26   ` JeffleXu
2022-09-15  6:45   ` JeffleXu
2022-09-14 10:50 ` [PATCH V3 3/6] erofs: introduce 'domain_id' mount option Jia Zhu
2022-09-15  7:30   ` JeffleXu
2022-09-15  7:43     ` [External] " Jia Zhu
2022-09-14 10:50 ` [PATCH V3 4/6] erofs: introduce fscache-based domain Jia Zhu
2022-09-14 13:21   ` Gao Xiang
2022-09-15  3:29     ` JeffleXu
2022-09-15  8:00     ` [External] " Jia Zhu
2022-09-15  3:27   ` JeffleXu
2022-09-14 10:50 ` [PATCH V3 5/6] erofs: introduce a pseudo mnt to manage shared cookies Jia Zhu
2022-09-15  5:43   ` JeffleXu
2022-09-14 10:50 ` [PATCH V3 6/6] erofs: Support sharing cookies in the same domain Jia Zhu
2022-09-14 13:30   ` Gao Xiang
2022-09-15  6:53   ` JeffleXu
2022-09-15  7:26     ` [External] " Jia Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).