From: Jan Kiszka <jan.kiszka@siemens.com>
To: Dave Hansen <dave.hansen@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: Optimize load_mm_cr4 to load_mm_cr4_irqsoff
Date: Tue, 18 Jun 2019 16:56:03 +0200 [thread overview]
Message-ID: <d9bcbb64-6961-c52f-bb8e-bef3c424e224@siemens.com> (raw)
In-Reply-To: <fc5cd013-c230-2eb2-02c5-cf9bbf350ec2@intel.com>
On 18.06.19 16:41, Dave Hansen wrote:
> On 6/18/19 12:32 AM, Jan Kiszka wrote:
>> Thus, we can avoid disabling interrupts again in cr4_set/clear_bits.
>
> Seems reasonable.
>
> Your *_irqsoff() variants need lockdep_assert_irqs_disabled(), at least,
> though.
It inherits this check via __cr4_set, so I didn't add that to the outer path.
>
> Can you talk a bit about the motivation here, though? Did you encounter
> some performance issue that led you to make this patch, or was it simply
> an improvement you realized you could make from code inspection?
>
I ran into a downstream issue adjusting patches to this code. In a nutshell,
Xenomai has something like an NMI context over most Linux code that shares some
codepaths with the kernel, though. One of them is switch_mm_irqs_off, and there
our checking logic warned. The rest was code inspection.
For upstream, this is a micro-optimization. But given that something like
switch_mm is in the path, I thought it's worth to propose.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2019-06-18 14:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 7:32 Jan Kiszka
2019-06-18 14:41 ` Dave Hansen
2019-06-18 14:56 ` Jan Kiszka [this message]
2019-07-23 18:52 ` Jan Kiszka
2019-07-24 10:19 ` Thomas Gleixner
2019-07-24 13:22 ` [tip:x86/mm] x86/mm: Avoid redundant interrupt disable in load_mm_cr4() tip-bot for Jan Kiszka
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=d9bcbb64-6961-c52f-bb8e-bef3c424e224@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--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®