public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Will Deacon <will@kernel.org>, paulmck <paulmck@kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3)
Date: Wed, 7 Oct 2020 12:11:57 -0400 (EDT)	[thread overview]
Message-ID: <1870892799.11183.1602087117694.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20201007160820.GK2628@hirez.programming.kicks-ass.net>

----- On Oct 7, 2020, at 12:08 PM, Peter Zijlstra peterz@infradead.org wrote:

> On Wed, Oct 07, 2020 at 11:39:30AM -0400, Mathieu Desnoyers wrote:
>> Moving the membarrier_switch_mm to cover kthread cases was to ensure (2), but if
>> we
>> add a p->mm NULL check in the global expedited iteration, I think we would be OK
>> leaving the stale runqueue's membarrier state while in lazy tlb state.
>> 
>> As far as (1) is concerned, I think your idea would work, because as you say we
>> will
>> have the proper barriers in kthread use/unuse mm.
>> 
>> I just wonder whether having this stale membarrier state for lazy tlb is
>> warranted
>> performance-wise, as it adds complexity: the rq membarrier state will therefore
>> not be
>> relevant when we are in lazy tlb mode.
>> 
>> Thoughts ?
> 
> Well, the way I got here was that I considered the membarrier state
> update tied to switch_mm(), and in that regard my proposal is a
> simplification.

Sounds good.

So for the loop check, do we need it to be:

                if ((p->flags & PF_KTHREAD) && !p->mm)
                        continue;

Or can it simply become:

                if (!p->mm)
                        continue;

Because AFAIU only PF_KTHREAD can have NULL p->mm (?)

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2020-10-07 16:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 17:25 [RFC PATCH 0/3] Membarrier updates Mathieu Desnoyers
2020-09-24 17:25 ` [RFC PATCH 1/3] sched: fix exit_mm vs membarrier (v3) Mathieu Desnoyers
2020-10-07 14:29   ` Peter Zijlstra
2020-10-07 14:57     ` Mathieu Desnoyers
2020-10-07 15:09       ` Peter Zijlstra
2020-09-24 17:25 ` [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3) Mathieu Desnoyers
2020-10-02  8:33   ` [sched] bdfcae1140: will-it-scale.per_thread_ops -37.0% regression kernel test robot
2020-10-07 14:50     ` Mathieu Desnoyers
2020-10-20  3:24       ` [LKP] " Xing Zhengjun
2020-10-20 13:14         ` Mathieu Desnoyers
2020-10-22  1:54           ` Xing Zhengjun
2020-10-22 13:19             ` Mathieu Desnoyers
2020-10-23  5:37               ` Xing Zhengjun
2020-10-23 12:34                 ` Mathieu Desnoyers
2020-10-07 15:07   ` [RFC PATCH 2/3] sched: membarrier: cover kthread_use_mm (v3) Peter Zijlstra
2020-10-07 15:39     ` Mathieu Desnoyers
2020-10-07 16:08       ` Peter Zijlstra
2020-10-07 16:11         ` Mathieu Desnoyers [this message]
2020-09-24 17:25 ` [RFC PATCH 3/3] sched: membarrier: document memory ordering scenarios Mathieu Desnoyers
2020-09-29 17:16 ` [RFC PATCH 0/3] Membarrier updates Mathieu Desnoyers

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=1870892799.11183.1602087117694.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=akpm@linux-foundation.org \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=npiggin@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@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