The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Rik van Riel <riel@surriel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH] x86,tlb: update mm_cpumask lazily
Date: Fri, 8 Nov 2024 12:10:47 -0800	[thread overview]
Message-ID: <90f8aaf2-ef9c-4777-b8db-17fc7c6cf41b@intel.com> (raw)
In-Reply-To: <55ada30f76d544a3f700e57a01cb6f6f255581d5.camel@surriel.com>

On 11/8/24 12:07, Rik van Riel wrote:
> On Fri, 2024-11-08 at 12:03 -0800, Dave Hansen wrote:
>> On 11/8/24 11:31, Rik van Riel wrote:
>>>  		/* Start receiving IPIs and then read tlb_gen (and
>>> LAM below) */
>>> -		if (next != &init_mm)
>>> +		if (next != &init_mm && !cpumask_test_cpu(cpu,
>>> mm_cpumask(next)))
>>>  			cpumask_set_cpu(cpu, mm_cpumask(next));
>>>  		next_tlb_gen = atomic64_read(&next-
>>>> context.tlb_gen);
>> If we're worried about contention on mm_cpumask(), then this hunk
>> makes
>> sense independently of the lazy updating. We might want to take this
>> hunk forward before we do the rest because this seems like a no-
>> brainer.
>>
> If we always clear the CPU in the mm_cpumask when prev != next,
> wouldn't that result in that CPU's bit being clear (and needing
> to be set) for next when prev != next?
> 
> What am I missing?

Oh, good point.  This is all in the (prev != next) block so yeah, the
bit _has_ to be clear.  Silly me.

  reply	other threads:[~2024-11-08 20:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 19:31 [PATCH] x86,tlb: update mm_cpumask lazily Rik van Riel
2024-11-08 20:03 ` Dave Hansen
2024-11-08 20:07   ` Rik van Riel
2024-11-08 20:10     ` Dave Hansen [this message]
2024-11-08 20:31 ` Dave Hansen
2024-11-08 20:41   ` Rik van Riel
2024-11-08 20:46 ` Dave Hansen

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=90f8aaf2-ef9c-4777-b8db-17fc7c6cf41b@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.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