From: Nadav Amit <namit@vmware.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>,
the arch/x86 maintainers <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC 7/7] x86/current: Aggressive caching of current
Date: Mon, 22 Jul 2019 21:20:46 +0000 [thread overview]
Message-ID: <9D1835AD-AB52-4B01-B783-67CB27CFEA9D@vmware.com> (raw)
In-Reply-To: <20190722210704.GL6698@worktop.programming.kicks-ass.net>
> On Jul 22, 2019, at 2:07 PM, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Thu, Jul 18, 2019 at 10:41:10AM -0700, Nadav Amit wrote:
>> The current_task is supposed to be constant in each thread and therefore
>> does not need to be reread. There is already an attempt to cache it
>> using inline assembly, using this_cpu_read_stable(), which hides the
>> dependency on the read memory address.
>
> Is that what it does?!, I never quite could understand
> percpu_stable_op().
That’s my understanding. I am not too pleased that I could not come up with
a general alternative to this_cpu_read_stable(), mainly because gcc does not
provide a way to get the type without the segment qualifier. Anyhow,
“current” seems to be the main pain-point.
I think a similar const-alias approach can also be used for stuff like
boot_cpu_has(). I have some patches for that somewhere, but the impact is
smaller. I do see some small, but measurable performance improvements with
this series. I’ll try to incorporate them in v1 once I have time.
next prev parent reply other threads:[~2019-07-22 21:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 17:41 [RFC 0/7] x86/percpu: Use segment qualifiers Nadav Amit
2019-07-18 17:41 ` [RFC 1/7] compiler: Report x86 segment support Nadav Amit
2019-07-18 17:41 ` [RFC 2/7] x86/percpu: Use compiler segment prefix qualifier Nadav Amit
2019-07-18 17:41 ` [RFC 3/7] x86/percpu: Use C for percpu accesses when possible Nadav Amit
2019-07-22 20:52 ` Peter Zijlstra
2019-07-22 21:12 ` Nadav Amit
2019-07-18 17:41 ` [RFC 4/7] x86: Fix possible caching of current_task Nadav Amit
2019-07-18 17:41 ` [RFC 5/7] percpu: Assume preemption is disabled on per_cpu_ptr() Nadav Amit
2019-07-18 17:41 ` [RFC 6/7] x86/percpu: Optimized arch_raw_cpu_ptr() Nadav Amit
2019-07-18 17:41 ` [RFC 7/7] x86/current: Aggressive caching of current Nadav Amit
2019-07-22 21:07 ` Peter Zijlstra
2019-07-22 21:20 ` Nadav Amit [this message]
2019-07-22 21:09 ` [RFC 0/7] x86/percpu: Use segment qualifiers Peter Zijlstra
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=9D1835AD-AB52-4B01-B783-67CB27CFEA9D@vmware.com \
--to=namit@vmware.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--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®