From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8E21C32771 for ; Tue, 16 Aug 2022 08:03:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbiHPIDB (ORCPT ); Tue, 16 Aug 2022 04:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbiHPICi (ORCPT ); Tue, 16 Aug 2022 04:02:38 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A212104B26 for ; Mon, 15 Aug 2022 22:24:19 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R401e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0VMOlw4x_1660627453; Received: from 30.97.49.25(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0VMOlw4x_1660627453) by smtp.aliyun-inc.com; Tue, 16 Aug 2022 13:24:14 +0800 Message-ID: <988f6a55-739e-8eab-4755-302716ea908e@linux.alibaba.com> Date: Tue, 16 Aug 2022 13:24:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH] sched/fair: limit burst to zero when cfs bandwidth is toggled off Content-Language: en-US To: Zhao Wenhui Cc: zhaogongyi@huawei.com, mingo@redhat.com, peterz@infradead.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, shanpeic@linux.alibaba.com, changhuaixin@linux.alibaba.com, tj@kernel.org, linux-kernel@vger.kernel.org References: <20220809120320.19496-1-zhaowenhui8@huawei.com> From: Tianchen Ding In-Reply-To: <20220809120320.19496-1-zhaowenhui8@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/8/9 20:03, Zhao Wenhui wrote: > When the quota value in CFS bandwidth is set to -1, that imples the > cfs bandwidth is toggled off. So the burst feature is supposed to > be disable as well. > > Currently, when quota is -1, burst will not be check, so that it can be > set to almost arbitery value. Examples: > mkdir /sys/fs/cgroup/cpu/test > echo -1 > /sys/fs/cgroup/cpu/test/cpu.cfs_quota_us > echo 10000000000000000 > /sys/fs/cgroup/cpu/test/cpu.cfs_burst_us > > Moreover, after the burst modified by this way, quota can't be set > to any value: > echo 100000 > cpu.cfs_quota_us > -bash: echo: write error: Invalid argument > > This patch can ensure the burst value being zero and unalterable, > when quota is set to -1. > > Fixes: f4183717b370 ("sched/fair: Introduce the burstable CFS controller") > Reported-by: Zhao Gongyi > Signed-off-by: Zhao Wenhui Nice catch! Thanks for the fix. Reviewed-by: Tianchen Ding