From: Thomas Gleixner <tglx@linutronix.de>
To: Balbir Singh <sblbir@amazon.com>, mingo@redhat.com
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
keescook@chromium.org, jpoimboe@redhat.com, tony.luck@intel.com,
benh@kernel.crashing.org, x86@kernel.org, dave.hansen@intel.com,
thomas.lendacky@amd.com, torvalds@linux-foundation.org,
Balbir Singh <sblbir@amazon.com>
Subject: Re: [PATCH v3 3/5] x86/mm: Optionally flush L1D on context switch
Date: Fri, 04 Dec 2020 22:21:09 +0100 [thread overview]
Message-ID: <87lfed9sje.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20201127065938.8200-4-sblbir@amazon.com>
On Fri, Nov 27 2020 at 17:59, Balbir Singh wrote:
>
> + /*
> + * Flush only if SMT is disabled as per the contract, which is checked
> + * when the feature is enabled.
> + */
> + if (sched_smt_active() && !this_cpu_read(cpu_info.smt_active) &&
> + (prev_mm & LAST_USER_MM_L1D_FLUSH))
> + l1d_flush_hw();
So if SMT is completely disabled then no flush? Shouldn't the logic be:
if ((!sched_smt_active() || !this_cpu_read(cpu_info.smt_active) &&
(prev_mm & LAST_USER_MM_L1D_FLUSH))
Hmm?
But that's bad, because it's lot's of conditions to evaluate for every
switch_mm where most of them are not interested in it at all.
Let me read through the rest of the pile.
Thanks,
tglx
next prev parent reply other threads:[~2020-12-04 21:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 6:59 [PATCH v3 0/5] Next revision of the L1D flush patches Balbir Singh
2020-11-27 6:59 ` [PATCH v3 1/5] x86/mm: change l1d flush runtime prctl behaviour Balbir Singh
2020-12-04 21:07 ` Thomas Gleixner
2020-12-04 22:44 ` Singh, Balbir
2020-11-27 6:59 ` [PATCH v3 2/5] x86/mm: Refactor cond_ibpb() to support other use cases Balbir Singh
2020-11-27 6:59 ` [PATCH v3 3/5] x86/mm: Optionally flush L1D on context switch Balbir Singh
2020-12-04 21:21 ` Thomas Gleixner [this message]
2020-12-04 22:41 ` Singh, Balbir
2020-11-27 6:59 ` [PATCH v3 4/5] prctl: Hook L1D flushing in via prctl Balbir Singh
2020-12-04 22:19 ` Thomas Gleixner
2020-12-05 2:56 ` Balbir Singh
2020-11-27 6:59 ` [PATCH v3 5/5] Documentation: Add L1D flushing Documentation Balbir Singh
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=87lfed9sje.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=benh@kernel.crashing.org \
--cc=dave.hansen@intel.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=sblbir@amazon.com \
--cc=thomas.lendacky@amd.com \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--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