mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hao Jia <jiahao.os@bytedance.com>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH v3 1/2] sched/core: Avoid obvious double update_rq_clock warning
Date: Sat, 30 Apr 2022 15:24:26 +0800	[thread overview]
Message-ID: <9b411c72-eda8-e98f-4e03-526ea645a7db@bytedance.com> (raw)
In-Reply-To: <0058249a-5f9f-9f67-db5b-f7c3c10c3729@arm.com>



On 2022/4/29 Dietmar Eggemann wrote:
> On 27/04/2022 10:00, Hao Jia wrote:
> 
> [...]
> 
> LGTM, comments are only nit-picks.
> 
>> Since we directly use raw_spin_rq_lock() to acquire rq lock instead of
>> rq_lock(), there is no corresponding change to rq->clock_update_flags.
>> In particular, we have obtained the rq lock of other cores,
> 
> s/cores/CPUs, with SMT, a core can have multiple (logical) CPUs.

Thanks for your review comments.
I will do it in patch v4.
Thanks.

> 
> [...]
> 
>> So we need to clear RQCF_UPDATED of rq->clock_update_flags synchronously
>> to avoid the WARN_DOUBLE_CLOCK warning.
> 
> Why you mention `synchronously` here? Isn't this obvious? (1)

I will do it in patch v4.
Thanks.

> 
> [...]
> 
>> @@ -1833,6 +1833,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int flags)
>>   static void migrate_task_rq_dl(struct task_struct *p, int new_cpu __maybe_unused)
>>   {
>>   	struct rq *rq;
>> +	struct rq_flags rf;
> 
> -       struct rq *rq;
>          struct rq_flags rf;
> +       struct rq *rq;
> 
> Use reverse fir tree order for variable declarations.
> (./Documentation/process/maintainer-tip.rst)

I will do it in patch v4.
Thanks.

> 
> [...]
> 
>> +#ifdef CONFIG_SCHED_DEBUG
>> +/*
>> + * In double_lock_balance()/double_rq_lock(), we use raw_spin_rq_lock() to acquire
>> + * rq lock instead of rq_lock(). So at the end of these two functions we need to
>> + * call double_rq_clock_clear_update() synchronously to clear RQCF_UPDATED of
>                                            ^^^^^^^^^^^^^
>                                            (1)
> 
>> + * rq->clock_update_flags to avoid the WARN_DOUBLE_CLOCK warning.
>> + */
>> +static inline void double_rq_clock_clear_update(struct rq *rq1, struct rq *rq2)
>> +{
>> +	rq1->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
>> +	/*
>> +	 * If CONFIG_SMP is not defined, rq1 and rq2 are the same,
>> +	 * so we just clear RQCF_UPDATED one of them.
>> +	 */
> 
> Maybe shorter:
> 
>        /* rq1 == rq2 for !CONFIG_SMP, so just clear RQCF_UPDATED once. */

I will do it in patch v4.
Thanks.
> 
> [...]
> 
>> @@ -2543,14 +2564,15 @@ static inline int _double_lock_balance(struct rq *this_rq, struct rq *busiest)
>>   	__acquires(busiest->lock)
>>   	__acquires(this_rq->lock)
>>   {
>> -	if (__rq_lockp(this_rq) == __rq_lockp(busiest))
>> -		return 0;
>> -
>> -	if (likely(raw_spin_rq_trylock(busiest)))
>> +	if (__rq_lockp(this_rq) == __rq_lockp(busiest) ||
>> +		likely(raw_spin_rq_trylock(busiest))) {
> 
> indention:
> 
>          if (__rq_lockp(this_rq) == __rq_lockp(busiest) ||
> -               likely(raw_spin_rq_trylock(busiest))) {
> +           likely(raw_spin_rq_trylock(busiest))) {

Thanks again for your review and suggestion.
I will do it in patch v4.
Thanks.

> 
> [...]
> 
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> 
> Tested on Arm64 Juno with mainline & preempt-rt (linux-5.17.y-rt).

  reply	other threads:[~2022-04-30  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  8:00 [PATCH v3 0/2] " Hao Jia
2022-04-27  8:00 ` [PATCH v3 1/2] " Hao Jia
2022-04-29 12:59   ` Dietmar Eggemann
2022-04-30  7:24     ` Hao Jia [this message]
2022-04-27  8:00 ` [PATCH v3 2/2] sched/deadline: Remove superfluous rq clock update in push_dl_task() Hao Jia
2022-04-29 14:30   ` Daniel Bristot de Oliveira

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=9b411c72-eda8-e98f-4e03-526ea645a7db@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=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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®