All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Ira Weiny <ira.weiny@intel.com>
Cc: David Sterba <dsterba@suse.cz>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] btrfs: Replace kmap() with kmap_local_page()
Date: Thu, 2 Jun 2022 17:46:48 +0100	[thread overview]
Message-ID: <YpjpeMsFsVUxuh3W@casper.infradead.org> (raw)
In-Reply-To: <Ypjjt87qL+ROFBtM@iweiny-desk3>

On Thu, Jun 02, 2022 at 09:22:15AM -0700, Ira Weiny wrote:
> On Wed, Jun 01, 2022 at 03:25:45PM +0200, David Sterba wrote:
> > On Tue, May 31, 2022 at 04:53:32PM +0200, Fabio M. De Francesco wrote:
> > > This is the first series of patches aimed towards the conversion of Btrfs
> > > filesystem from the use of kmap() to kmap_local_page().
> > 
> > We've already had patches converting kmaps and you're changing the last
> > ones, so this is could be the last series, with two exceptions.
> > 
> > 1) You've changed lzo.c and zlib. but the same kmap/kunmap pattern is
> >    used in zstd.c.
> 
> I checked out zstd.c and one of the issues there is the way that the input
> workspace is mapped page by page while iterating those pages.
> 
> This got me thinking about what Willy said at LSFmm concerning something like
> kmap_local_range().  Mapping more than 1 page at a time could save some
> unmap/remap of output pages required for kmap_local_page() ordering.

Umm ... Not entirely sure what I said, but it'd be really hard to kmap
multiple pages with the current PAE implementation.  I've steered away
from doing that for now, and kmap_local_folio() just guarantees the
page that the offset lands in is mapped.

I don't think the right answer is having a kmap_folio() that will map
the entire folio.  I'd be more tempted to add vmap_folio() for that.
My understanding is that PAE systems have more address space available
for vmap than they do for kmap.

> Unfortunately, I think the length of the input is probably to long in many
> cases.  And some remapping may still be required.
> 
> Cc: Willy
> 
> As an aside, Willy, I'm thinking that a kmap_local_range() should return a
> folio in some way.  Would you agree?

I imagine it taking a folio to describe the range that's being accessed.
But maybe it should be a phys_addr_t?  I tend to prefer phys_addr_t over
pfn + offset as it's more compact on 64-bit systems and the same on
32-bit systems.

  reply	other threads:[~2022-06-02 16:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 14:53 [PATCH 0/3] btrfs: Replace kmap() with kmap_local_page() Fabio M. De Francesco
2022-05-31 14:53 ` [PATCH 1/3] btrfs: Replace kmap() with kmap_local_page() in inode.c Fabio M. De Francesco
2022-05-31 15:46   ` Christoph Hellwig
2022-05-31 14:53 ` [PATCH 2/3] btrfs: Replace kmap() with kmap_local_page() in lzo.c Fabio M. De Francesco
2022-05-31 15:53   ` Christoph Hellwig
2022-05-31 14:53 ` [PATCH 3/3] btrfs: Replace kmap() with kmap_local_page() in zlib.c Fabio M. De Francesco
2022-05-31 15:53   ` Christoph Hellwig
2022-05-31 20:35   ` kernel test robot
2022-06-01 19:57     ` Fabio M. De Francesco
2022-06-01 19:57       ` Fabio M. De Francesco
2022-06-01 13:25 ` [PATCH 0/3] btrfs: Replace kmap() with kmap_local_page() David Sterba
2022-06-02 16:22   ` Ira Weiny
2022-06-02 16:46     ` Matthew Wilcox [this message]
2022-06-02 18:01   ` Fabio M. De Francesco
2022-06-02 15:20 ` Christoph Hellwig
2022-06-02 15:55   ` Ira Weiny
2022-06-02 16:28   ` David Sterba
2022-06-05 15:11     ` Fabio M. De Francesco
2022-06-06 10:32       ` David Sterba
2022-06-06 14:32         ` Fabio M. De Francesco
2022-06-02 18:59 [PATCH 3/3] btrfs: Replace kmap() with kmap_local_page() in zlib.c kernel test robot
2022-06-06 12:11 ` Dan Carpenter
2022-06-06 12:11 ` Dan Carpenter

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=YpjpeMsFsVUxuh3W@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=dsterba@suse.cz \
    --cc=fmdefrancesco@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.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 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.