mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Libo Chen <libo.chen@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
	"mgorman@suse.de" <mgorman@suse.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Daniel Jordan <daniel.m.jordan@oracle.com>
Subject: Re: [PATCH 1/1] sched/fair: Fix inaccurate tally of ttwu_move_affine
Date: Thu, 9 Mar 2023 03:17:50 +0000	[thread overview]
Message-ID: <1EB52D2D-C1E2-47A4-AF30-10068B6F4EC9@oracle.com> (raw)
In-Reply-To: <82d4e87d-edc5-19e9-bfa8-70029610457e@oracle.com>



> On Jan 9, 2023, at 2:00 PM, Libo Chen <libo.chen@oracle.com> wrote:
> 
> Hi Peter,
> 
> A gentle ping~ Vincent has signed it off. Let me know what else I should do for this patch.
> 
> Libo
> 
> On 8/15/22 12:19 PM, Libo Chen wrote:
>> 
>> 
>> On 8/15/22 04:01, Peter Zijlstra wrote:
>>> On Wed, Aug 10, 2022 at 03:33:13PM -0700, Libo Chen wrote:
>>>> There are scenarios where non-affine wakeups are incorrectly counted as
>>>> affine wakeups by schedstats.
>>>> 
>>>> When wake_affine_idle() returns prev_cpu which doesn't equal to
>>>> nr_cpumask_bits, it will slip through the check: target == nr_cpumask_bits
>>>> in wake_affine() and be counted as if target == this_cpu in schedstats.
>>>> 
>>>> Replace target == nr_cpumask_bits with target != this_cpu to make sure
>>>> affine wakeups are accurately tallied.
>>>> 
>>>> Fixes: 806486c377e33 (sched/fair: Do not migrate if the prev_cpu is idle)
>>>> Suggested-by: Daniel Jordan <daniel.m.jordan@oracle.com>
>>>> Signed-off-by: Libo Chen <libo.chen@oracle.com>
>>>> ---
>>>>   kernel/sched/fair.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>> 
>>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>>> index da388657d5ac..b179da4f8105 100644
>>>> --- a/kernel/sched/fair.c
>>>> +++ b/kernel/sched/fair.c
>>>> @@ -6114,7 +6114,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p,
>>>>           target = wake_affine_weight(sd, p, this_cpu, prev_cpu, sync);
>>>>         schedstat_inc(p->stats.nr_wakeups_affine_attempts);
>>>> -    if (target == nr_cpumask_bits)
>>>> +    if (target != this_cpu)
>>>>           return prev_cpu;
>>>>         schedstat_inc(sd->ttwu_move_affine);
>>> This not only changes the accounting but also the placement, no?
>> No, it should only change the accounting. wake_affine() still returns prev_cpu if target equals to prev_cpu or nr_cpumask_bits, the same behavior as before.
>> 

Hi Peter,

A second ping in case you missed the first one, what else should I do to get this fix in?


Libo 

>> 
>> Libo
> 


  reply	other threads:[~2023-03-09  3:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 22:33 Libo Chen
2022-08-15 11:01 ` Peter Zijlstra
2022-08-15 19:19   ` Libo Chen
2022-08-17 13:20     ` Vincent Guittot
2023-01-09 22:00     ` Libo Chen
2023-03-09  3:17       ` Libo Chen [this message]
2022-08-25  7:30 ` Gautham R. Shenoy
2022-08-25  9:13   ` Libo Chen
2023-03-30 10:39     ` Gautham R. Shenoy
2023-04-06 10:05 ` [tip: sched/core] " tip-bot2 for Libo 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=1EB52D2D-C1E2-47A4-AF30-10068B6F4EC9@oracle.com \
    --to=libo.chen@oracle.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.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

all inboxes | Powered by JetHome®