Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp93193lqp; Tue, 21 May 2024 20:16:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUA03i53wl1zhjt58yApZZah+uJPCUtd9LKt7NhFpjQg9TsGePMvTgEI0Odp3Rfei14VlE7JSblimiCcLW/DrgdzZkGiajfZzFFl6Uezg== X-Google-Smtp-Source: AGHT+IGYpwsKztQs0FwY0+N6v4mVOpV6eLa/9H3vEdFY23SXJ7W3Vm2aqUkhqQLLdD9NsFvTYeGk X-Received: by 2002:a05:6214:4b12:b0:6ab:701b:bffc with SMTP id 6a1803df08f44-6ab7f3498e8mr8831226d6.7.1716347787252; Tue, 21 May 2024 20:16:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716347787; cv=pass; d=google.com; s=arc-20160816; b=YtFS3nJJ0SKTRfYZYUq0zOlnz3iZtrUQJBXp6vP2q8LRQUMVZA3LGb+jT+ZTI9gdJ9 rcSRkRnRE+9h2nalqPkFhs2J6dNzajwBQ6cpLUPYK6x0bVN4is98iVX/o9XqOVafn5OR +4FuyPKB6oTpDVmAxZ7Lb91CltMyD1q/TVk2s9/4SYsjHEIDQ8K+mdDHx1+xdL7y8ykO sfq264L5Y2334bSVHkd/V2eO2ZSd6abtfIVLmuZ7fOqSCOiCA7NcwtYjNToqE5hQOvU5 GakhoDrxjgxO6/f566HSbVXFjks60sCqmmaldHjAw0ovXbHNvB/L55yh9IG/OL0e4+Wk vrWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=+hFM4EEh8yF0WvThoLqqPJmZw785ljRns6EcVaYYH58=; fh=1+7r10/Az3CaHSYay03RUWXHMqFYibaETiZXPvCa0jc=; b=CH1jWS3RO1pm/3t/HmG+ImFQ4mvtQjmNPeeLJAhAjada0PafHQxFMIRUyZo/zVCe0e WzpzhDcsBADRTzYWjuHhgJHpCx/LcuLeuxehboYI25T6B2ix/+L/vfqGKKjCUHfw2YsY 0Sepjeyy2rdigTf55qhCdChvhnh6zHcFvAiS5VyMkLJ2ukXdp0kYDTkFu/J0DoPIDMqW 1LXLu5feRbpXECjX4z7hrzwRUTDfnAh1MJMaZaUBXs+1p+KPbk8ziERrhvj64iyZ1WQX Bz7AdasM2p24YimkXnLk596R6GXKI68mOeRno+TB+Jp2nl4CLSX8/3Qhk9PMvY/3xms0 6QDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-185712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab780af107si22471966d6.214.2024.05.21.20.16.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 20:16:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-185712-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185712-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F3ACF1C20BBF for ; Wed, 22 May 2024 03:16:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7071674E26; Wed, 22 May 2024 03:16:06 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D06A214295 for ; Wed, 22 May 2024 03:16:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716347766; cv=none; b=dfqLdXoCTDXjR9hKOoO168mmkE2JRB37MRilUhryU1qsA2dYCNb5YqWvH/lQI6GTxwXedu7BAZmrIjEqmFeHA31d/Vi3RUPURx69UebPLiPpiSKlNk+rTw5ZxpuqAu1hwCHsoqj+JTJp6COXI1ew65UO1ERvpmvrXWwE3sJVnv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716347766; c=relaxed/simple; bh=nXZtuUsWNOhDKw25i9SHciZzMx/bGrHST16YDSwVn5w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YtnLTl04ZffMtbkvqvoEyWmrnYpyCmmyqJrnG9JZko7sYwgrTRH8Z4ciYfsCVqBMO8MWhASpKZRTMLHGXsEsAVrhQigbuqh2lap3l2CZpVENUZOVOXsASF/6jNNEGUHc4CnonRzMvsJal6RceicqlSgZ4KZw0+9LIY2u1AYTw8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Vkbtm57JmzXnpl; Wed, 22 May 2024 11:11:44 +0800 (CST) Received: from kwepemf500005.china.huawei.com (unknown [7.202.181.243]) by mail.maildlp.com (Postfix) with ESMTPS id 34F741401E9; Wed, 22 May 2024 11:15:56 +0800 (CST) Received: from huawei.com (10.67.174.161) by kwepemf500005.china.huawei.com (7.202.181.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 22 May 2024 11:15:55 +0800 From: Cheng Yu To: , , , , , , , , , , , , , , CC: , , , , , Subject: [PATCH 2/2] sched/fair: set burst to zero when set max to cpu.max Date: Wed, 22 May 2024 11:10:07 +0800 Message-ID: <20240522031007.643498-3-serein.chengyu@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240522031007.643498-1-serein.chengyu@huawei.com> References: <20240522031007.643498-1-serein.chengyu@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemf500005.china.huawei.com (7.202.181.243) In the cgroup v2 cpu subsystem, assuming we have a cgroup named 'test', and we set cpu.max and cpu.max.burst: # echo 1000000 > /sys/fs/cgroup/test/cpu.max # echo 1000000 > /sys/fs/cgroup/test/cpu.max.burst Next we remove the restriction on cfs bandwidth: # echo max > /sys/fs/cgroup/test/cpu.max # cat /sys/fs/cgroup/test/cpu.max max 100000 # cat /sys/fs/cgroup/test/cpu.max.burst 1000000 Now we expect that the value of burst should be 0. When the burst is 0, it means that the restriction on burst is cancelled. Fixes: f4183717b370 ("sched/fair: Introduce the burstable CFS controller") Reported-by: Qixin Liao Signed-off-by: Cheng Yu --- kernel/sched/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e9198e30bb74..982d357b3983 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -11414,8 +11414,11 @@ static ssize_t cpu_max_write(struct kernfs_open_file *of, int ret; ret = cpu_period_quota_parse(buf, &period, "a); - if (!ret) + if (!ret) { + if (quota == RUNTIME_INF) + burst = 0; ret = tg_set_cfs_bandwidth(tg, period, quota, burst); + } return ret ?: nbytes; } #endif -- 2.25.1