From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Hao Jia <jiahao.os@bytedance.com>, Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [External] Re: [PATCH] sched/core: Avoid obvious double update_rq_clock warning
Date: Thu, 21 Apr 2022 12:32:17 +0200 [thread overview]
Message-ID: <4b2af80f-a6d6-30b3-11f2-8f5e3e6e5c5f@arm.com> (raw)
In-Reply-To: <84f61791-8cf2-b955-5d71-1cab15129ab2@bytedance.com>
On 21/04/2022 09:24, Hao Jia wrote:
> On 2022/4/21 Dietmar Eggemann wrote:
>> On 20/04/2022 10:29, Hao Jia wrote:
>>> On 4/19/22 6:48 PM, Peter Zijlstra wrote:
>>>> On Mon, Apr 18, 2022 at 05:09:29PM +0800, Hao Jia wrote:
[...]
> Thanks for your review.
> This is very helpful to me.
> If CONFIG_SMP is not enabled, should we just clear the RQCF_UPDATED of
> one of rq1 and q2?
>
> like this:
> rq1->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
[...]
We could take care of that within rq_clock_clear_update() if really
needed?
Anyway, for !CONFIG_SMP builds rq_clock_clear_update() has to be defined
outside #ifdef CONFIG_SMP.
-->8--
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 3a77b10d7cc4..614b822c667c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2484,6 +2484,17 @@ unsigned long arch_scale_freq_capacity(int cpu)
}
#endif
+#ifdef CONFIG_SCHED_DEBUG
+static inline void rq_clock_clear_update(struct rq *rq1, struct rq *rq2)
+{
+ rq1->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
+#ifdef CONFIG_SMP
+ rq2->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
+#endif
+}
+#else
+static inline void rq_clock_clear_update(struct rq *rq1, struct rq *rq2) {}
+#endif
#ifdef CONFIG_SMP
@@ -2515,16 +2526,6 @@ static inline bool rq_order_less(struct rq *rq1, struct rq *rq2)
extern void double_rq_lock(struct rq *rq1, struct rq *rq2);
-#ifdef CONFIG_SCHED_DEBUG
-static inline void rq_clock_clear_update(struct rq *rq1, struct rq *rq2)
-{
- rq1->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
- rq2->clock_update_flags &= (RQCF_REQ_SKIP|RQCF_ACT_SKIP);
-}
-#else
-static inline void rq_clock_clear_update(struct rq *rq1, struct rq *rq2) {}
-#endif
-
#ifdef CONFIG_PREEMPTION
/*
next prev parent reply other threads:[~2022-04-21 10:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 9:09 [PATCH] sched/core: Avoid obvious double update_rq_clock warning Hao Jia
2022-04-19 10:48 ` Peter Zijlstra
2022-04-20 8:29 ` [External] " Hao Jia
2022-04-20 19:11 ` Dietmar Eggemann
2022-04-21 7:24 ` Hao Jia
2022-04-21 10:32 ` Dietmar Eggemann [this message]
2022-04-21 12:30 ` Dietmar Eggemann
2022-04-21 13:15 ` [External] " 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=4b2af80f-a6d6-30b3-11f2-8f5e3e6e5c5f@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=jiahao.os@bytedance.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;
as well as URLs for NNTP newsgroup(s).