mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuyi Zhou <zhouchuyi@bytedance.com>
To: Benjamin Segall <bsegall@google.com>
Cc: 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 2/2] sched/core: Avoid unnecessary update in tg_set_cfs_bandwidth
Date: Tue, 23 Jul 2024 10:34:33 +0800	[thread overview]
Message-ID: <afc464cb-1d47-48f8-b56c-59f4c7b92eef@bytedance.com> (raw)
In-Reply-To: <xm26plr5ysij.fsf@google.com>



在 2024/7/23 06:24, Benjamin Segall 写道:
> Chuyi Zhou <zhouchuyi@bytedance.com> writes:
> 
>> In the kubernetes production environment, we have observed a high
>> frequency of writes to cpu.max, approximately every 2~4 seconds for each
>> cgroup, with the same value being written each time. This can result in
>> unnecessary overhead, especially on machines with a large number of CPUs
>> and cgroups.
>>
>> This is because kubelet and runc attempt to persist resource
>> configurations through frequent updates with same value in this manner.
>> While optimizations can be made to kubelet and runc to avoid such
>> overhead(e.g. check the current value of cpu request/limit before writing
>> to cpu.max), it is still worth to bail out from tg_set_cfs_bandwidth() if
>> we attempt to update with the same value.
> 
> Yeah, this is silly of userspace, but we also do the same sort of check
> for shares, so sure.
> 
> We do need it to be inside of a lock though, multiple threads could
> in theory write to the file at once. Just move it down inside of
> cfs_constraints_mutex and that's fine.
> 

Thanks, I will send v2 later.

      reply	other threads:[~2024-07-23  2:34 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
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 [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=afc464cb-1d47-48f8-b56c-59f4c7b92eef@bytedance.com \
    --to=zhouchuyi@bytedance.com \
    --cc=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 \
    /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®