linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Lin Shengwang <linshengwang1@huawei.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, aubrey.li@linux.intel.com,
	dietmar.eggemann@arm.com, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	vschneid@redhat.com, linux-kernel@vger.kernel.org,
	cj.chengjian@huawei.com
Subject: Re: [PATCH -next] sched/core: Fix the bug that traversal in sched_group_cookie_match is wrong
Date: Mon, 10 Oct 2022 09:37:14 +0200	[thread overview]
Message-ID: <Y0PLqng6tdbWA0/Z@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20221008022709.642-1-linshengwang1@huawei.com>

On Sat, Oct 08, 2022 at 10:27:09AM +0800, Lin Shengwang wrote:
> In commit 97886d9dcd86 ("sched: Migration changes for core scheduling"),
> sched_group_cookie_match() was added to help finding cookie matched
> group, but was inconsistent with the actual purpose.
> 
> Using cpu_rq(cpu) instead of rq to fix the bug.
> 
> Fixes: 97886d9dcd86 ("sched: Migration changes for core scheduling")
> Signed-off-by: Lin Shengwang <linshengwang1@huawei.com>
> ---
>  kernel/sched/sched.h | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 23c6f9f42ba1..1ba602139840 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h

> @@ -1269,7 +1277,7 @@ static inline bool sched_group_cookie_match(struct rq *rq,
>  		return true;
>  
>  	for_each_cpu_and(cpu, sched_group_span(group), p->cpus_ptr) {
> -		if (sched_core_cookie_match(rq, p))
> +		if (sched_core_cookie_match(cpu_rq(cpu), p))
>  			return true;

Urgh.. Thanks!

  parent reply	other threads:[~2022-10-10  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-08  2:27 [PATCH -next] sched/core: Fix the bug that traversal in sched_group_cookie_match is wrong Lin Shengwang
2022-10-10  1:14 ` Aubrey Li
2022-10-10  7:37 ` Peter Zijlstra [this message]
2022-10-17 14:45 ` [tip: sched/urgent] sched/core: Fix comparison in sched_group_cookie_match() tip-bot2 for Lin Shengwang

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=Y0PLqng6tdbWA0/Z@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=aubrey.li@linux.intel.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=cj.chengjian@huawei.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linshengwang1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --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).