From: Peter Zijlstra <peterz@infradead.org>
To: Hao Jia <jiahao.os@bytedance.com>
Cc: mingo@redhat.com, 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,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Igor Raits <igor.raits@gmail.com>,
Bagas Sanjaya <bagasdotme@gmail.com>
Subject: Re: [PATCH v2] sched/core: Fix RQCF_ACT_SKIP leak
Date: Fri, 20 Oct 2023 12:46:01 +0200 [thread overview]
Message-ID: <20231020104601.GA33965@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20231012090003.11450-1-jiahao.os@bytedance.com>
On Thu, Oct 12, 2023 at 05:00:03PM +0800, Hao Jia wrote:
> Igor Raits and Bagas Sanjaya report a RQCF_ACT_SKIP leak warning.
> Link: https://lore.kernel.org/all/a5dd536d-041a-2ce9-f4b7-64d8d85c86dc@gmail.com
>
> This warning may be triggered in the following situations:
>
> CPU0 CPU1
>
> __schedule()
> *rq->clock_update_flags <<= 1;* unregister_fair_sched_group()
> pick_next_task_fair+0x4a/0x410 destroy_cfs_bandwidth()
> newidle_balance+0x115/0x3e0 for_each_possible_cpu(i) *i=0*
> rq_unpin_lock(this_rq, rf) __cfsb_csd_unthrottle()
> raw_spin_rq_unlock(this_rq)
> rq_lock(*CPU0_rq*, &rf)
> rq_clock_start_loop_update()
> rq->clock_update_flags & RQCF_ACT_SKIP <--
> raw_spin_rq_lock(this_rq)
>
> The purpose of RQCF_ACT_SKIP is to skip the update rq clock,
> but the update is very early in __schedule(), but we clear
> RQCF_*_SKIP very late, causing it to span that gap above
> and triggering this warning.
>
> In __schedule() we can clear the RQCF_*_SKIP flag immediately
> after update_rq_clock() to avoid this RQCF_ACT_SKIP leak warning.
> And set rq->clock_update_flags to RQCF_UPDATED to avoid
> rq->clock_update_flags < RQCF_ACT_SKIP warning that may be triggered later.
>
Thanks!
prev parent reply other threads:[~2023-10-20 10:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 9:00 [PATCH v2] sched/core: Fix RQCF_ACT_SKIP leak Hao Jia
2023-10-20 10:46 ` Peter Zijlstra [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=20231020104601.GA33965@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bagasdotme@gmail.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=igor.raits@gmail.com \
--cc=jiahao.os@bytedance.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=rostedt@goodmis.org \
--cc=stable@vger.kernel.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