mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	<linux-erofs@lists.ozlabs.org>, Chao Yu <chao@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] erofs: use kmap_local_page() only for erofs_bread()
Date: Wed, 19 Oct 2022 20:17:31 -0700	[thread overview]
Message-ID: <Y1C9y2y/87tIgfia@iweiny-mobl> (raw)
In-Reply-To: <Y1Cv/LuiGpVdO5im@B-P7TQMD6M-0146.local>

On Thu, Oct 20, 2022 at 10:18:36AM +0800, Gao Xiang wrote:
> On Wed, Oct 19, 2022 at 08:17:05PM +0200, Fabio M. De Francesco wrote:
> > On Wednesday, October 19, 2022 1:36:55 AM CEST Gao Xiang wrote:
> > > On Wed, Oct 19, 2022 at 01:21:27AM +0200, Fabio M. De Francesco wrote:
> > > > On Tuesday, October 18, 2022 11:29:21 PM CEST Gao Xiang wrote:

[snip]

> 
> That is not the simple nested unmapped case as you said above, I could take
> a very brief example:

Building on this.  The uncompressed pages always outnumber the compressed
pages, right?

> 
> 1. map a decompresed page
> 2. map a compressed page

First reverse these because you are going to need to map a new decompressed
page before another compressed page.  So:

1. map compressed
2. map decompressed

Then 4/5 and 7/8 become unmap/map new without issue.

> 3. working
> 4. decompressed page is all consumed, unmap the current decompressed page
> 5. map the next decompressed page
> 6. working
> 7. decompressed page is all consumed, unmap the current decompressed page
> 8. map the next decompressed page
> 9. working

This is more complicated but not overly so.

Simply

9.1 unmap decompressed

> 10. compressed page is all consumed, unmap the current compressed page
> 11. map the next compressed page

11.1 remap decompressed

> 12. working
> 13. ... (anyway, unmap and remap a compressed page or a decompressed page
>          in any order.)
> 
> until all process is finished.  by using kmap(), it's much simple to
> implement this, but kmap_local(), it only complexes the code.

Agreed kmap() is easier but I think this could work.

Basically you keep the compressed mapped first.

I also assume there is also a reverse of this so reverse the pages in that
case.

Thoughts?
Ira

  reply	other threads:[~2022-10-20  3:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 10:53 Gao Xiang
2022-10-18 16:28 ` Fabio M. De Francesco
2022-10-18 19:18 ` Fabio M. De Francesco
2022-10-18 21:29   ` Gao Xiang
2022-10-18 23:21     ` Fabio M. De Francesco
2022-10-18 23:36       ` Gao Xiang
2022-10-19  2:51         ` Ira Weiny
2022-10-19  3:06           ` Gao Xiang
2022-10-19 18:17         ` Fabio M. De Francesco
2022-10-20  2:18           ` Gao Xiang
2022-10-20  3:17             ` Ira Weiny [this message]
2022-10-20  3:50               ` Gao Xiang
2022-12-01 10:09 ` Jingbo Xu
2022-12-07  1:16 ` Chao Yu

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=Y1C9y2y/87tIgfia@iweiny-mobl \
    --to=ira.weiny@intel.com \
    --cc=chao@kernel.org \
    --cc=fmdefrancesco@gmail.com \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®