mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hao Jia <jiahao.os@bytedance.com>
To: Phil Auld <pauld@redhat.com>
Cc: 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, bristot@redhat.com,
	vschneid@redhat.com, mgorman@techsingularity.net,
	linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH v3] sched/core: Adapt WARN_DOUBLE_CLOCK machinery for core-sched
Date: Tue, 4 Apr 2023 17:06:39 +0800	[thread overview]
Message-ID: <612c77f3-2983-b010-a4ef-4fbaf57064b5@bytedance.com> (raw)
In-Reply-To: <20230331125813.GA782283@lorien.usersys.redhat.com>



On 2023/3/31 Phil Auld wrote:
> Hi,
> 
> On Thu, Mar 30, 2023 at 11:58:27AM +0800 Hao Jia wrote:
>> When sched_core_enabled(), we sometimes need to call update_rq_clock()
>> to update the rq clock of sibling CPUs on the same core, before that we
>> need to clear RQCF_UPDATED of rq->clock_update_flags to avoid the
>> WARN_DOUBLE_CLOCK warning. Because at this time the rq->clock_update_flags
>> of sibling CPUs may be RQCF_UPDATED. If sched_core_enabled(), we will get
>> a core wide rq->lock, so at this point we can safely clear RQCF_UPDATED of
>> rq->clock_update_flags of all CPUs on this core to avoid the
>> WARN_DOUBLE_CLOCK warning.
>>
>> We sometimes use rq_pin_lock() and raw_spin_rq_lock() separately,
>> For example newidle_balance() and _double_lock_balance(). We will
>> temporarily give up core wide rq->lock, and then use raw_spin_rq_lock()
>> to reacquire core wide rq->lock without rq_pin_lock(), so We can not
>> clear RQCF_UPDATED of rq->clock_update_flags of other cpus on the
>> same core in rq_pin_lock().
>>
>> Steps to reproduce:
>> 1. Enable CONFIG_SCHED_DEBUG and CONFIG_SCHED_CORE when compiling
>>     the kernel
>> 2. echo 1 > /sys/kernel/debug/clear_warn_once
>>     echo "WARN_DOUBLE_CLOCK" > /sys/kernel/debug/sched/features
>> 3. Run the linux/tools/testing/selftests/sched/cs_prctl_test test
>>
>> Signed-off-by: Hao Jia <jiahao.os@bytedance.com>
> 
> I think this looks good. One small nit is that I think you might
> replace "core wide" with "core-wide" everywhere.
> 
> 
> Reviewed-by: Phil Auld <pauld@redhat.com>
> 

Thank you for your review, I will do it in the next version.

Thanks,
Hao

      reply	other threads:[~2023-04-04  9:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  3:58 Hao Jia
2023-03-31 12:58 ` Phil Auld
2023-04-04  9:06   ` Hao Jia [this message]

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=612c77f3-2983-b010-a4ef-4fbaf57064b5@bytedance.com \
    --to=jiahao.os@bytedance.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pauld@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®