mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Hao Jia <jiahao.kernel@gmail.com>, <mingo@redhat.com>,
	<peterz@infradead.org>, <mingo@kernel.org>,
	<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
	<dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
	<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, Hao Jia <jiahao1@lixiang.com>
Subject: Re: [PATCH] sched/core: Remove double update_rq_clock() in __set_cpus_allowed_ptr_locked()
Date: Thu, 30 Oct 2025 09:34:00 +0530	[thread overview]
Message-ID: <ee2746bd-1baa-48b1-bdaf-89c14a21b4fc@amd.com> (raw)
In-Reply-To: <20251029093655.31252-1-jiahao.kernel@gmail.com>

Hello Hao,

On 10/29/2025 3:06 PM, Hao Jia wrote:
> From: Hao Jia <jiahao1@lixiang.com>
> 
> Since commit d4c64207b88a ("sched: Cleanup the sched_change NOCLOCK usage"),
> update_rq_clock() is called in do_set_cpus_allowed() -> sched_change_begin()
> to update the rq clock. This results in a duplicate call update_rq_clock()
> in __set_cpus_allowed_ptr_locked().
> 
> While holding the rq lock and before calling do_set_cpus_allowed(),
> there is nothing that depends on an updated rq_clock.

I couldn't spot any dependency on rq_clock() until do_set_cpus_allowed()
either so please feel free to include:

Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>

-- 
Thanks and Regards,
Prateek

> 
> Therefore, remove the redundant update_rq_clock() in
> __set_cpus_allowed_ptr_locked() to avoid the warning about double
> rq clock updates.
> 
> Fixes: d4c64207b88a ("sched: Cleanup the sched_change NOCLOCK usage")
> Signed-off-by: Hao Jia <jiahao1@lixiang.com>
> ---
>  kernel/sched/core.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 1842285eac1e..1123cd0ddffb 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2999,8 +2999,6 @@ static int __set_cpus_allowed_ptr_locked(struct task_struct *p,
>  	unsigned int dest_cpu;
>  	int ret = 0;
>  
> -	update_rq_clock(rq);
> -
>  	if (kthread || is_migration_disabled(p)) {
>  		/*
>  		 * Kernel threads are allowed on online && !active CPUs,


  reply	other threads:[~2025-10-30  4:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29  9:36 Hao Jia
2025-10-30  4:04 ` K Prateek Nayak [this message]
2025-10-30  9:14   ` Peter Zijlstra
2025-11-11 11:37 ` [tip: sched/core] " tip-bot2 for Hao Jia

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=ee2746bd-1baa-48b1-bdaf-89c14a21b4fc@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jiahao.kernel@gmail.com \
    --cc=jiahao1@lixiang.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --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

all inboxes | Powered by JetHome®