linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Breno Leitao <leitao@debian.org>
Cc: Peter Zijlstra <peterz@infradead.org>, Tejun Heo <tj@kernel.org>,
	David Vernet <void@manifault.com>,
	Changwoo Min <changwoo@igalia.com>,
	Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
	kernel-team@meta.com, jake@hillion.co.uk
Subject: Re: [PATCH] sched/ext: Suppress warning in __this_cpu_write() by disabling preemption
Date: Wed, 16 Jul 2025 18:13:10 +0200	[thread overview]
Message-ID: <aHfPlm2wXPJQQiQn@gpd4> (raw)
In-Reply-To: <imrfubmkw3a6qdznnpounrnen5ituzchwtbjmouocuk77upn67@ljrz32ppyqyr>

On Wed, Jul 16, 2025 at 09:08:36AM -0700, Breno Leitao wrote:
> On Wed, Jul 16, 2025 at 04:26:23PM +0200, Andrea Righi wrote:
> > On Wed, Jul 16, 2025 at 03:36:31PM +0200, Peter Zijlstra wrote:
> > > On Wed, Jul 16, 2025 at 03:15:12PM +0200, Andrea Righi wrote:
> > > 
> > > > The idea is to track the scx callbacks that are invoked with a rq lock held
> > > > and, in those cases, store the locked rq. However, some callbacks may also
> > > > be invoked from an unlocked context, where no rq is locked and in this case
> > > > rq should be NULL.
> > > > 
> > > > In the latter case, it's acceptable for preemption to remain enabled, but
> > > > we still want to explicitly set locked_rq = NULL. If during the execution
> > > > of the callback we jump on another CPU, it'd still be in an unlocked state,
> > > > so it's locked_rq is still NULL.
> > > 
> > > Right; but doing superfluous NULL stores seems pointless. So better to
> > > avoid the store entirely, rather than making it more expensive and no
> > > less pointless, right?
> > 
> > Right, we can definitely avoid rewriting NULL.
> > The following should do the trick.
> > 
> > Breno, can you give it a try?
> 
> Sure thing. I've tested it and I don't see the warning on my side.
> 
> Would you like to me post the patch, probably removing the WARN_ONCE()
> as raised by peterz?

Sure, go ahead. Yes, let's remove the WARN_ON_ONCE().
And thanks Peter for all the suggestions!

-Andrea

  reply	other threads:[~2025-07-16 16:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 12:46 [PATCH] sched/ext: Suppress warning in __this_cpu_write() by disabling preemption Breno Leitao
2025-07-16 12:51 ` Peter Zijlstra
2025-07-16 13:15   ` Andrea Righi
2025-07-16 13:20     ` Breno Leitao
2025-07-16 13:40       ` Peter Zijlstra
2025-07-16 13:36     ` Peter Zijlstra
2025-07-16 14:26       ` Andrea Righi
2025-07-16 15:49         ` Peter Zijlstra
2025-07-16 16:08         ` Breno Leitao
2025-07-16 16:13           ` Andrea Righi [this message]
2025-07-16 12:54 ` Steven Rostedt
2025-07-16 13:06   ` Peter Zijlstra
2025-07-16 13:20     ` Andrea Righi
2025-07-16 13:33       ` 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=aHfPlm2wXPJQQiQn@gpd4 \
    --to=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jake@hillion.co.uk \
    --cc=juri.lelli@redhat.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.com \
    /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).