mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	<linux-kernel@vger.kernel.org>, <linux-sgx@vger.kernel.org>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "Borislav Petkov" <bp@alien8.de>,
	<x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Kristen Carlson Accardi <kristen@linux.intel.com>
Subject: Re: [PATCH] x86/sgx: Replace kmap/kunmap_atomic calls
Date: Thu, 6 Oct 2022 16:17:39 -0700	[thread overview]
Message-ID: <Yz9iEwCZDa4F5pii@iweiny-desk3> (raw)
In-Reply-To: <3dfccc80-e089-4915-d57e-96d26b237182@intel.com>

On Thu, Oct 06, 2022 at 03:29:35PM -0700, Hansen, Dave wrote:
> On 10/6/22 15:02, Fabio M. De Francesco wrote:
> > On Thursday, October 6, 2022 10:45:56 PM CEST Dave Hansen wrote:
> > Am I still missing anything fundamental?
> 
> Yes. :)
> 
> kmap() users can sleep.  That means the number of them that you need to
> keep around is unbounded.  kmap_atomic()'s fundamentally can't sleep so
> you need fewer of them.  That means that when you kunmap_atomic() you
> can use a simple, fast, CPU-local TLB flushing operation.  kunmap()
> eventually requires a big fat global TLB flush.
> 
> So, you're right.  On lowmem-only systems, kmap() *can* be cheaper than
> kmap_atomic().  But, on highmem systems there's no contest:
> kmap_atomic() is king.
> 
> That's why kmap_atomic() is and should be the default.

But in the last few years optimizing lowmem systems has been the default.  Few
care about the performance of highmem systems.

Given that we don't want to ever use kmap() nor kmap_atomic() going forward I
think this discussion is purely academic.

Ira

  reply	other threads:[~2022-10-06 23:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 16:06 Kristen Carlson Accardi
2022-09-30 21:55 ` Jarkko Sakkinen
2022-10-06 20:37 ` Fabio M. De Francesco
2022-10-06 20:45   ` Dave Hansen
2022-10-06 21:26     ` Ira Weiny
2022-10-06 22:02     ` Fabio M. De Francesco
2022-10-06 22:29       ` Dave Hansen
2022-10-06 23:17         ` Ira Weiny [this message]
2022-10-07 15:23 ` Ira Weiny
2022-10-12  7:15   ` Jarkko Sakkinen
2022-10-12  7:26     ` Jarkko Sakkinen
2022-10-12 14:13     ` Dave Hansen
2022-10-12 14:50       ` Jarkko Sakkinen
2022-10-12 15:50         ` Jarkko Sakkinen
2022-10-13 16:03           ` Kristen Carlson Accardi

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=Yz9iEwCZDa4F5pii@iweiny-desk3 \
    --to=ira.weiny@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jarkko@kernel.org \
    --cc=kristen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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®