linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/5] Introduce erofs shared domain
@ 2022-09-02 10:53 Jia Zhu
  2022-09-02 10:53 ` [PATCH V2 1/5] erofs: add 'domain_id' mount option for on-demand read sementics Jia Zhu
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Jia Zhu @ 2022-09-02 10:53 UTC (permalink / raw)
  To: linux-erofs, xiang, chao; +Cc: linux-kernel, huyue2, linux-fsdevel, yinxin.x

Changes since V1:
0. Only initialize one pseudo fs to manage anonymous inodes(cookies).
1. Remove ctx's 'ref' field and replace it with inode's i_count.
2. Add lock in erofs_fscache_unregister_cookie() to avoid race condition
   between cookie's get/put/search.
3. Remove useless blank lines.

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

[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.
[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 

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/


Jia Zhu (5):
  erofs: add 'domain_id' mount option for on-demand read sementics
  erofs: introduce fscache-based domain
  erofs: add 'domain_id' prefix when register sysfs
  erofs: remove duplicated unregister_cookie
  erofs: support fscache based shared domain

 fs/erofs/fscache.c  | 168 +++++++++++++++++++++++++++++++++++++++++++-
 fs/erofs/internal.h |  31 +++++++-
 fs/erofs/super.c    |  94 +++++++++++++++++++------
 fs/erofs/sysfs.c    |  11 ++-
 4 files changed, 278 insertions(+), 26 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2022-09-14  3:16 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 10:53 [PATCH V2 0/5] Introduce erofs shared domain Jia Zhu
2022-09-02 10:53 ` [PATCH V2 1/5] erofs: add 'domain_id' mount option for on-demand read sementics Jia Zhu
2022-09-02 10:53 ` [PATCH V2 2/5] erofs: introduce fscache-based domain Jia Zhu
2022-09-09  8:42   ` JeffleXu
2022-09-13  4:31     ` [External] " Jia Zhu
2022-09-13  6:34       ` JeffleXu
2022-09-14  3:02   ` JeffleXu
2022-09-14  3:15     ` [External] " Jia Zhu
2022-09-02 10:53 ` [PATCH V2 3/5] erofs: add 'domain_id' prefix when register sysfs Jia Zhu
2022-09-09  9:23   ` JeffleXu
2022-09-09  9:26     ` JeffleXu
2022-09-13  4:35       ` [External] " Jia Zhu
2022-09-02 10:53 ` [PATCH V2 4/5] erofs: remove duplicated unregister_cookie Jia Zhu
2022-09-09  9:55   ` JeffleXu
2022-09-09 10:28     ` JeffleXu
2022-09-13  4:52       ` [External] " Jia Zhu
2022-09-13  4:37     ` Jia Zhu
2022-09-02 10:53 ` [PATCH V2 5/5] erofs: support fscache based shared domain Jia Zhu
2022-09-13  6:27   ` JeffleXu
2022-09-13 12:59     ` [External] " Jia Zhu
2022-09-08  6:49 ` [PATCH V2 0/5] Introduce erofs " 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).