public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Chen Yu <yu.c.chen@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Vincent Guittot <vincent.guittot@linaro.org>,
	linux-kernel@vger.kernel.org,
	Vinicius Gomes <vinicius.gomes@intel.com>
Subject: Re: [PATCH] sched/balance: Skip unnecessary updates to idle load balancer's flags
Date: Tue, 04 Jun 2024 15:32:11 -0700	[thread overview]
Message-ID: <acb5d2789f0a2fa81f95c81d4c21d122cfddb244.camel@linux.intel.com> (raw)
In-Reply-To: <Zl53lXjEmnWhlW8p@chenyu5-mobl2>

On Tue, 2024-06-04 at 10:10 +0800, Chen Yu wrote:
> 
> > 
> > Not sure I follow your comments about return being safe.  Let me explain
> > in details.
> > 
> > We will return directly if and only if the bits set in flags are also set
> > in nohz_flags(ilb_cpu).  
> > 
> > The comment's intention is to say that if the above statement is true, then
> > the later operation of 
> > 
> > 	atomic_fetch_or(flags, nohz_flags(ilb_cpu))
> > 
> > will be useless and not result in any change to nohz_flags(ilb_cpu), since all the set bits
> > in flags are already set in nohz_flags(ilb_cpu).
> 
> Understand. My previous thought was that, what if the current nohz_flags(ilb_cpu) is 0 or
> NOHZ_NEWILB_KICK. If yes, return directly might miss one ipi to the ilb_cpu(because
> the current code checks flags & NOHZ_KICK_MASK to return directly). But from the current
> logic when we reach kick_ilb(), the flag is not 0, and the flag passed by nohz_balancer_kick()
> satisfy (flags & NOHZ_KICK_MASK), so returns here is ok.

Should not have issues of missing an IPI.  kick_ilb(flags) is always called with non-zero flags
value.  And the first guy who update nohz_flags(ilb_cpu) successfully with bits
in the NOHZ_KICK_MASK will send the IPI.

Tim




  reply	other threads:[~2024-06-04 22:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 20:54 [PATCH] sched/balance: Skip unnecessary updates to idle load balancer's flags Tim Chen
2024-06-02 16:40 ` Chen Yu
2024-06-03 16:13   ` Tim Chen
2024-06-04  2:10     ` Chen Yu
2024-06-04 22:32       ` Tim Chen [this message]
2024-06-04 14:37 ` Vincent Guittot
2024-06-05 14:54 ` [tip: sched/core] " tip-bot2 for Tim Chen
2024-06-05 17:07   ` Tim Chen

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=acb5d2789f0a2fa81f95c81d4c21d122cfddb244.camel@linux.intel.com \
    --to=tim.c.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vinicius.gomes@intel.com \
    --cc=yu.c.chen@intel.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