public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Segall <bsegall@google.com>
To: Zhang Qiao <zhangqiao22@huawei.com>
Cc: Chuyi Zhou <zhouchuyi@bytedance.com>,  <mingo@redhat.com>,
	<peterz@infradead.org>,  <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>,  <dietmar.eggemann@arm.com>,
	<rostedt@goodmis.org>,  <mgorman@suse.de>,  <vschneid@redhat.com>,
	<chengming.zhou@linux.dev>,  <linux-kernel@vger.kernel.org>,
	<joshdon@google.com>
Subject: Re: [PATCH 1/2] sched/fair: Decrease cfs bandwidth usage in task_group destruction
Date: Mon, 22 Jul 2024 15:20:07 -0700	[thread overview]
Message-ID: <xm26ttghysq0.fsf@google.com> (raw)
In-Reply-To: <5607f1e2-b235-4eda-a9d9-2e9519db3f74@huawei.com> (Zhang Qiao's message of "Mon, 22 Jul 2024 16:16:12 +0800")

Zhang Qiao <zhangqiao22@huawei.com> writes:

> 在 2024/7/22 15:46, Chuyi Zhou 写道:
>>>>
>>>> Thanks for your information.
>>>>
>>>> I think maybe cfs_bandwidth_usage_dec() should be moved to other more suitable places where could
>>>> hold hotplug lock(e.g. cpu_cgroup_css_released()). I would do some test to verify it.
>>>>
>>>
>>> The cpu_cgroup_css_released() also doesn't seem to be in the cpu hotplug lock-holding context.
>>>
>> 
>> IIUC, cpus_read_lock/cpus_read_unlock can be called in cpu_cgroup_css_released() right? But cfs
>> bandwidth destroy maybe run in a rcu callback since task group list is protected by RCU so we could not
>> get the lock. Did I miss something important?
>
>
> Okay, you're right. I ignored that we can't hold the hotplug lock in an rcu callback.

Yeah, cpu_cgroup_css_released/cpu_cgroup_css_free are fine I think, and
I think it should be correct to move the call to destroy_cfs_bandwidth() to
cpu_cgroup_css_free (it's unfortunate in terms of code organization, but
as far as correctness goes it should be fine).

As far as the diff goes, the _dec should go after the
__cfsb_csd_unthrottle loop.

  reply	other threads:[~2024-07-22 22:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21 12:52 [PATCH 0/2] minor cpu bandwidth control fix Chuyi Zhou
2024-07-21 12:52 ` [PATCH 1/2] sched/fair: Decrease cfs bandwidth usage in task_group destruction Chuyi Zhou
2024-07-22  3:47   ` Zhang Qiao
2024-07-22  6:04     ` Chuyi Zhou
2024-07-22  7:16       ` Zhang Qiao
2024-07-22  7:46         ` Chuyi Zhou
2024-07-22  8:16           ` Zhang Qiao
2024-07-22 22:20             ` Benjamin Segall [this message]
2024-07-21 12:52 ` [PATCH 2/2] sched/core: Avoid unnecessary update in tg_set_cfs_bandwidth Chuyi Zhou
2024-07-22  7:21   ` Chengming Zhou
2024-07-22 22:24   ` Benjamin Segall
2024-07-23  2:34     ` Chuyi Zhou

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=xm26ttghysq0.fsf@google.com \
    --to=bsegall@google.com \
    --cc=chengming.zhou@linux.dev \
    --cc=dietmar.eggemann@arm.com \
    --cc=joshdon@google.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 \
    --cc=vschneid@redhat.com \
    --cc=zhangqiao22@huawei.com \
    --cc=zhouchuyi@bytedance.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