linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Balbir Singh <sblbir@amazon.com>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
	tony.luck@intel.com, keescook@chromium.org, x86@kernel.org,
	benh@kernel.crashing.org, dave.hansen@intel.com
Subject: Re: [PATCH 3/3] arch/x86: Optionally flush L1D on context switch
Date: Fri, 3 Apr 2020 00:11:09 +0200	[thread overview]
Message-ID: <20200402221109.GJ9352@zn.tnic> (raw)
In-Reply-To: <20200402062401.29856-4-sblbir@amazon.com>

On Thu, Apr 02, 2020 at 05:24:01PM +1100, Balbir Singh wrote:
> +int enable_l1d_flush_for_task(struct task_struct *tsk)
> +{
> +	struct page *page;
> +	int ret = 0;
> +
> +	if (static_cpu_has(X86_FEATURE_FLUSH_L1D))
> +		goto done;
> +
> +	page = READ_ONCE(l1d_flush_pages);
> +	if (unlikely(!page)) {
> +		mutex_lock(&l1d_flush_mutex);
> +		if (!l1d_flush_pages) {
> +			l1d_flush_pages = alloc_l1d_flush_pages();
> +			if (!l1d_flush_pages)
> +				return -ENOMEM;

Do I see it correctly that you'll return here with l1d_flush_mutex still
held?

> +		}
> +		mutex_unlock(&l1d_flush_mutex);
> +	}
> +	/* I don't think we need to worry about KSM */

Pls use passive voice: no "we" or "I", etc.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2020-04-02 22:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02  6:23 [PATCH 0/3] arch/x86: Optionally flush L1D on context switch Balbir Singh
2020-04-02  6:23 ` [PATCH 1/3] arch/x86/kvm: Refactor l1d flush lifecycle management Balbir Singh
2020-04-02  6:24 ` [PATCH 2/3] arch/x86: Refactor tlbflush and l1d flush Balbir Singh
2020-04-02  6:24 ` [PATCH 3/3] arch/x86: Optionally flush L1D on context switch Balbir Singh
2020-04-02 22:11   ` Borislav Petkov [this message]
2020-04-02 22:18     ` Singh, Balbir
2020-04-02 20:13 ` [PATCH 0/3] " Josh Poimboeuf
2020-04-02 20:35   ` Singh, Balbir
2020-04-02 20:47     ` Josh Poimboeuf
2020-04-02 21:45       ` Thomas Gleixner
2020-04-02 22:23         ` Singh, Balbir

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=20200402221109.GJ9352@zn.tnic \
    --to=bp@alien8.de \
    --cc=benh@kernel.crashing.org \
    --cc=dave.hansen@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sblbir@amazon.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).