From: 胡玮文 <sehuww@mail.scut.edu.cn>
To: Gao Xiang <hsiangkao@redhat.com>
Cc: linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] erofs-utils: get rid of inode->i_srcpath
Date: Mon, 5 Apr 2021 20:11:35 +0800 [thread overview]
Message-ID: <20210405121135.GA159690@laptop> (raw)
In-Reply-To: <20210405113525.GB378859@xiangao.remote.csb>
On Mon, Apr 05, 2021 at 07:35:25PM +0800, Gao Xiang wrote:
> Hi Weiwen,
>
> On Mon, Apr 05, 2021 at 05:49:50PM +0800, Hu Weiwen wrote:
> > This cut the memory usage by half.
> >
> > Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn>
> > ---
>
> I have to hold on this patch for now, 3 main reasons here:
> 1) I'd like to apply big pcluster first, which is a main new feature
> for erofs-utils 1.3;
OK
> 2) even though it saves memory usage (and not sure how much memory
> you need to save), I think srcpath is more useful for debugging
> and file tracing; Also, I think we could flush inode in advance to
> save memory usage (e.g. by using bflush()) as well.
I think flush in advance is a good idea. But it needs more investigation.
Ideally, I want to make the space complexity O(1), so that we can pack an
arbitrarily large number of files. It's better not to save every seen inode
structure in memory.
If I remember it correctly, when packing a dataset consisting of ~5m files,
mkfs.erofs takes 30-40GiB memory. I think this can hinder some use cases.
As for debugging, maybe we can create a routine that travels up the directory
tree to rebuild the path when needed? (Just like `pwd'.) Or, for mkfs, we can
just pass around a pointer to the current working path.
Thanks,
Hu Weiwen
> 3) if src_path is too large, how about malloc() it as the first step,
> even that, I'd like to apply it after erofs-utils 1.3 is out...
>
> Thanks,
> Gao Xiang
prev parent reply other threads:[~2021-04-05 12:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 9:49 [PATCH] erofs-utils: get rid of inode->i_srcpath Hu Weiwen
2021-04-05 11:35 ` Gao Xiang
2021-04-05 12:11 ` 胡玮文 [this message]
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=20210405121135.GA159690@laptop \
--to=sehuww@mail.scut.edu.cn \
--cc=hsiangkao@redhat.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