From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org, hsiangkao@linux.alibaba.com
Subject: [PATCH 0/6] erofs-utils: introduce extra xattr name prefix
Date: Tue, 4 Apr 2023 16:02:17 +0800 [thread overview]
Message-ID: <20230404080224.77577-1-jefflexu@linux.alibaba.com> (raw)
As discussed in [1], erofs paring with overlayfs could satisfy the
scenario which originally composefs targets. In this case, each file of
erofs is tagged with overlay.metacopy and overlay.redirect xattr, which
can be consumed by overlayfs.
The example xattr arrangement is like:
user.overlay.metacopy=""
user.overlay.redirect="/d6/a6748c13e2ef146a9587c47cd51ef692a368b180fc3d32b1ee32df4bb99133"
In the current implementation of erofs, "user.overlay.redirect" xattr
name will consume duplicate on-disk space. In other words, each file
will allocate on-disk space for its "user.overlay.redirect" xattr name,
which explodes the output erofs image as a consequence.
This patch set introduces extra xattr name prefix feature, in which user
could specify customised xattr name prefix through mkfs.erofs. When
matched with a user specified extra xattr name prefix, only the
trailing part of the xattr name apart from the xattr name prefix will be
stored on disk. Please refer to patch 3 for more details of the on-disk
format.
This feature can significantly reduces the size of the output erofs image
in the scenario where files share the same xattr name or prefix heavily.
Below is the test result of the size of the output erofs image with
different option combinations of mkfs.erofs. This is tested on the
rootfs givin in [2].
```
4.2M large.erofs.T0.noxattr
7.4M large.erofs.T0.xattr
6.4M large.erofs.T0.xattr.share
5.7M large.erofs.noxattr
8.9M large.erofs.xattr
7.8M large.erofs.xattr.share
```
T0: "-T0" of mkfs.erofs, w/ this option, 32 bytes on-disk inode is used;
wo/ this option, 64 byte on-disk inode is used instead
xattr: no extra option specified
noxattr: "-x -1", i.e. disable xattr
share: "--xattr-prefix=user.overlay.metacopy" and
"--xattr-prefix=user.overlay.redirect" option of mkfs.erofs. w/ this
option, the extra xattr name prefix feature is enabled.
It can be seen ~10% disk space is saved with this feature in the typical
workload.
patch 1-2 are preparing patch.
[1] https://lore.kernel.org/all/CAOQ4uxgGc33_QVBXMbQTnmbpHio4amv=W7ax2vQ1UMet0k_KoA@mail.gmail.com/
[2] https://my.owndrive.com/index.php/s/irHJXRpZHtT3a5i
Jingbo Xu (6):
erofs-utils: declare prefix_len as u8
erofs-utils: extract packedfile API
erofs-utils: introduce on-disk format for extra xattr name prefix
erofs-utils: introduce init/cleanup routine for extra xattr name prefix
erofs-utils: build erofs_xattr_entry upon extra xattr name prefix
erofs-utils: mkfs.erofs: introduce --xattr-prefix option
include/erofs/config.h | 2 +
include/erofs/fragments.h | 19 +++++--
include/erofs/inode.h | 2 +
include/erofs/internal.h | 3 ++
include/erofs/xattr.h | 3 ++
include/erofs_fs.h | 7 ++-
lib/fragments.c | 20 +++-----
lib/xattr.c | 104 +++++++++++++++++++++++++++++++++++++-
mkfs/main.c | 48 +++++++++++++++---
9 files changed, 183 insertions(+), 25 deletions(-)
--
2.19.1.6.gb485710b
next reply other threads:[~2023-04-04 8:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 8:02 Jingbo Xu [this message]
2023-04-04 8:02 ` [PATCH 1/6] erofs-utils: declare prefix_len as u8 Jingbo Xu
2023-04-04 8:02 ` [PATCH 2/6] erofs-utils: extract packedfile API Jingbo Xu
2023-04-04 8:02 ` [PATCH 3/6] erofs-utils: introduce on-disk format for extra xattr name prefix Jingbo Xu
2023-04-04 8:19 ` Gao Xiang
2023-04-04 8:02 ` [PATCH 4/6] erofs-utils: introduce init/cleanup routine " Jingbo Xu
2023-04-04 8:02 ` [PATCH 5/6] erofs-utils: build erofs_xattr_entry upon " Jingbo Xu
2023-04-04 8:02 ` [PATCH 6/6] erofs-utils: mkfs.erofs: introduce --xattr-prefix option Jingbo Xu
2023-04-04 8:02 ` [PATCH] tmp debug Jingbo Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230404080224.77577-1-jefflexu@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox