All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yue Hu <zbestahu@gmail.com>
Cc: linux-erofs@lists.ozlabs.org, Yue Hu <huyue2@yulong.com>,
	geshifei@yulong.com, zhangwen@yulong.com, shaojunjun@yulong.com
Subject: Re: [RFC PATCH 1/2] erofs-utils: support tail-packing inline compressed data
Date: Wed, 27 Oct 2021 15:34:58 +0800	[thread overview]
Message-ID: <YXkBIpcCG12Y8qMN@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <20211027152137.000043e5.zbestahu@gmail.com>

Hi Yue,

On Wed, Oct 27, 2021 at 03:21:37PM +0800, Yue Hu wrote:

...

> > > > -		if (len <= pclustersize) {
> > > > +		if (!tail_pcluster && len <= pclustersize) {
> > > >  			if (final) {
> > > > -				if (len <= EROFS_BLKSIZ)
> > > > +				if (erofs_sb_has_tailpacking()) {
> > > > +					tail_pcluster = true;
> > > > +					pclustersize = EROFS_BLKSIZ;  
> > > 
> > > Not quite sure if such condition can be trigged for many times...
> > > 
> > > Think about it. If the original pclustersize == 16 * EROFS_BLKSIZ, so we
> > > could have at least 16 new pclustersize == EROFS_BLKSIZ then?
> > > 
> > > But only the last pclustersize == EROFS_BLKSIZ can be inlined...
> > 
> > Let me think about it more.
> 
> I understand we need to compress the tail pcluster(len <= pclustersize) by destsize
> of fixed 4KB to get better inline result. rt?

I think this is the tricky part of tail-packing inline support for
compressed data.

As you may know, EROFS supports variable-sized blocks for each pcluster
so you could change pclustersize accordingly for the last pclusters.

For example, originally if the size of the last one pcluster is
16 * EROFS_BLKSIZ (therefore it cannot be tail-packing directly), there
are 2 policies in practice can be achieved:
 1) compress with 2 pclusters ---
      X pcluster size + Y (Y <= 4KiB) pcluster size (so the last one can
   be tail-packing);
 2) compress with 4KiB pclusters ---
      4KiB pcluster + 4KiB pcluster + ... + Z (Z <= 4KiB) pcluster

I'm not sure which one is easier to implement, maybe 2) is easier, so we
could implement it first.

Thanks,
Gao Xiang


  reply	other threads:[~2021-10-27  7:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 12:30 [RFC PATCH 0/2] erofs-utils: compression inline feature Yue Hu
2021-10-25 12:30 ` [RFC PATCH 1/2] erofs-utils: support tail-packing inline compressed data Yue Hu
2021-10-26 12:00   ` Gao Xiang
2021-10-27  1:58     ` Yue Hu
2021-10-27  7:21       ` Yue Hu
2021-10-27  7:34         ` Gao Xiang [this message]
2021-10-27  8:02           ` Yue Hu
2021-10-25 12:30 ` [RFC PATCH 2/2] erofs-utils: fuse: " Yue Hu

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=YXkBIpcCG12Y8qMN@B-P7TQMD6M-0146.local \
    --to=hsiangkao@linux.alibaba.com \
    --cc=geshifei@yulong.com \
    --cc=huyue2@yulong.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=shaojunjun@yulong.com \
    --cc=zbestahu@gmail.com \
    --cc=zhangwen@yulong.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.