All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>
Subject: Re: folio_map
Date: Wed, 17 Aug 2022 18:28:02 -0700	[thread overview]
Message-ID: <Yv2VouJb2pNbP59m@iweiny-desk3> (raw)
In-Reply-To: <Yv1ezcVV62w0O87V@casper.infradead.org>

On Wed, Aug 17, 2022 at 10:34:05PM +0100, Matthew Wilcox wrote:
> On Wed, Aug 17, 2022 at 01:52:33PM -0700, Ira Weiny wrote:
> > On Wed, Aug 17, 2022 at 01:23:41PM -0700, Ira wrote:
 
[snip]

> > > How many folios do you think will need to be mapped at a time?  And is there
> > > any practical limit on their size?  Are 64k blocks a reasonable upper bound
> > > until highmem can be deprecated completely?
> > > 
> > > I say this because I'm not sure that mapping a 64k block would always fail.
> > > These mappings are transitory.  How often will a filesystem be mapping more
> > > than 2 folios at once?
> > 
> > I did the math wrong but I think my idea can still work.
> 
> The thing is that kmap_local_page() can be called from interrupt context
> (how often is it?  no idea).  So you map two 64kB folios (at 16 entries
> each) and that consumes 32 entries for this CPU, now you take an interrupt
> and that's 33.  I don't know how deep that goes; can we have some mapped
> in userspace, some mapped in softirq and then another interrupt causes
> more to be mapped in hardirq?  I don't really want to find out, so I'd
> rather always punt to vmap() for multipage folios.
> 
> Is there a reason you want to make folio_map_local() more efficient
> on HIGHMEM systems?

It is not about efficiency.  It is about making the callers of
folio_map_local() not have to worry about the context it is used in.

If 64 entries is not enough how many?  I'm trying to see if there is any bound
we could reasonably establish?  Even kmap_local_page() _may_ run out of
entries.

Ira

  reply	other threads:[~2022-08-18  1:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 18:08 folio_map Matthew Wilcox
2022-08-16 21:23 ` folio_map John Hubbard
2022-08-17 10:29 ` folio_map Kirill A. Shutemov
2022-08-17 19:38   ` folio_map Matthew Wilcox
2022-08-17 20:23     ` folio_map Ira Weiny
2022-08-17 20:52       ` folio_map Ira Weiny
2022-08-17 21:34         ` folio_map Matthew Wilcox
2022-08-18  1:28           ` Ira Weiny [this message]
2022-08-18  0:25 ` folio_map Dave Chinner
2022-08-18 21:10 ` [RFC] vmap_folio() Matthew Wilcox
2022-08-19 10:53   ` Uladzislau Rezki
2022-08-19 15:45     ` Matthew Wilcox
2022-08-22 19:54       ` Uladzislau Rezki

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=Yv2VouJb2pNbP59m@iweiny-desk3 \
    --to=ira.weiny@intel.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=willy@infradead.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.