|
|
Log in / Subscribe / Register

Introduce erofs shared domain

From:  Jia Zhu <zhujia.zj-AT-bytedance.com>
To:  linux-erofs-AT-lists.ozlabs.org, xiang-AT-kernel.org, chao-AT-kernel.org
Subject:  [RFC PATCH 0/5] Introduce erofs shared domain
Date:  Wed, 31 Aug 2022 20:31:20 +0800
Message-ID:  <20220831123125.68693-1-zhujia.zj@bytedance.com>
Cc:  linux-fsdevel-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, yinxin.x-AT-bytedance.com, jefflexu-AT-linux.alibaba.com, huyue2-AT-coolpad.com, Jia Zhu <zhujia.zj-AT-bytedance.com>
Archive-link:  Article

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

[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: (More test cases will be added.)
	https://github.com/userzj/demand-read-cachefilesd/tree/sh...

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/Makefile   |   2 +-
 fs/erofs/domain.c   | 175 ++++++++++++++++++++++++++++++++++++++++++++
 fs/erofs/fscache.c  |  17 ++++-
 fs/erofs/internal.h |  34 ++++++++-
 fs/erofs/super.c    |  45 +++++++++---
 fs/erofs/sysfs.c    |  11 ++-
 6 files changed, 270 insertions(+), 14 deletions(-)
 create mode 100644 fs/erofs/domain.c

-- 
2.20.1



Copyright © 2022, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds