[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acb5d2789f0a2fa81f95c81d4c21d122cfddb244.camel@linux.intel.com>
Date: Tue, 04 Jun 2024 15:32:11 -0700
From: Tim Chen <tim.c.chen@...ux.intel.com>
To: Chen Yu <yu.c.chen@...el.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>, linux-kernel@...r.kernel.org,
Vinicius Gomes <vinicius.gomes@...el.com>
Subject: Re: [PATCH] sched/balance: Skip unnecessary updates to idle load
balancer's flags
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
Powered by blists - more mailing lists