Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp441109lqb; Tue, 28 May 2024 23:21:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX005V4esf1ZokyRJUSgwhdu3OWQgDM7TwkOmwnd0Ckzwi1VgTXJEd6QgoWkjZVmQpe/zEpZnyDPH/gAkUbWkhN5QuUWmms4sewzzqidA== X-Google-Smtp-Source: AGHT+IHUHwMprrGUKq70JzaobAdmMpT7qBW/D89G30Ugj1fbwY7m/4eIA6I5BYA9Ci4o6VcUylBp X-Received: by 2002:ac8:5e0c:0:b0:43b:1561:6c41 with SMTP id d75a77b69052e-43fb0e53b2emr169283031cf.1.1716963659974; Tue, 28 May 2024 23:20:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716963659; cv=pass; d=google.com; s=arc-20160816; b=vcRZxmAATCJd5DwD6FRKaPDg1SulXw2mAiFwt7CrIztQVooM+NpQ3GPwQxqnaFrI6+ F/32HV6qzaksfenrphHI94VzteHvePtH60FcJdvx7RowTwqSN6kzaCCjl8LofwAhwS/r hYNgWsLNlG9Cr4OB/+DRytkNh1W1I13/CBKI4ZhQclgXbkACRjFYMs4gtu519KXAg/Uo Lhs2f03Qh9lfdup4/E+ZNlRSxnHP1TdadzhBTWR7zyKWmZKemIZqGDGtth4c16K0ExF9 wqfypJQVlY/J8gSsD0xkGHtWDAdyU7fTqxmAqqCOfpbAOC98H8r4Sv/Wvl9z8LP6W4iq drxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=VwHfud3NP/G4noQymednVmw7K9DhRrCBKnLN9sqkDsU=; fh=nxQGRuZNUY0/z7Lk/EVJhTpdInqdpaLNCE05IxTm72k=; b=YYugJsocPcOi1pX41lLeYRxbP9WR2fVogaGTuXBIJ5I/O6QyQagUj7vNA6hAVh9qtv PSMhqtBUIVojd6b9GTpRVk8DpL+JGhkVl00cdRy7/Prd6qTwMytF/kSxFl5RdP1rF8YX 6+96srQdf2LsLfd4Ls1eTFTe+fvMHyFb228AZTmHpP+O5FT2AJo/rV7uDeX8BjV0F+/y BTrQZQEW8yjrLF5r94R0ABExyzxViqOUoO2k+qBs5eZUPXC857MfBvm0VW9kS0m8PW9m FX6Dn9/K5cpoDMFFNr0ipwS9i9iVBBNKWg4X+HesH1xHHldEJKhfdvCDH9fts1SsSZfo JAmA==; 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-193503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193503-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 d75a77b69052e-43fb18b16c3si75925661cf.416.2024.05.28.23.20.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 23:20:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193503-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-193503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193503-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 7FB291C210A7 for ; Wed, 29 May 2024 06:20:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F47F15EFDA; Wed, 29 May 2024 06:20:54 +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 E49AD1391 for ; Wed, 29 May 2024 06:20:49 +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=1716963653; cv=none; b=MO83X9/qCjy5f2nFZ/lFvY80h8bk5SdiB6rkV+7UN9ZwznW0MCjGhBIuV+0MMHECbF3qLbTGkQe97zF0Mrp+NnkCQxefUmb2gaG1J/i6Wc1yBHvuvlZONpWghkpcOhPjbZx9/qIj9LA/Xz6/yFKtvdf9pPveq4U1Ij9LVNe8POA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716963653; c=relaxed/simple; bh=DjbOGAclJVdyRt4mD6ki6T6PGnHsWxWRXoaHnmm0iPo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Gq4SlyWkzSwiqtnGxlta8VkuHHeoH2WKt0SxjSp0PCg75gsBaUOUV4Uxg401N/i0w6zQWktLAqRXBiZz1iOxHsdI9zzGyQqzYQxbIXZnDQoAjdZ1eurdld+qpqIgEYa4j0q9Fo1BfRi1HsMEFsP/Nlp79ZTCMW2IQHudcNc8hp8= 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.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Vpzfc4H8hzlWqC; Wed, 29 May 2024 14:16:24 +0800 (CST) Received: from kwepemf500005.china.huawei.com (unknown [7.202.181.243]) by mail.maildlp.com (Postfix) with ESMTPS id DCAD5180A9C; Wed, 29 May 2024 14:20:46 +0800 (CST) Received: from [10.67.111.212] (10.67.111.212) 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, 29 May 2024 14:20:45 +0800 Message-ID: Date: Wed, 29 May 2024 14:20:45 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] sched/fair: set burst to zero when set max to cpu.max To: Benjamin Segall CC: , , , , , , , , , , , , , , , , , , References: <20240522031007.643498-1-serein.chengyu@huawei.com> <20240522031007.643498-3-serein.chengyu@huawei.com> Content-Language: en-US From: Cheng Yu In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf500005.china.huawei.com (7.202.181.243) On 2024/5/29 7:10, Benjamin Segall wrote: > Cheng Yu writes: > >> 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 > > Yeah, makes sense. My general assumption would be to put these in one > patch, but if there's a convention to separate v1 and v2 that I've > missed, I have no opinion. > > Reviewed-by: Ben Segall > Thanks for the advice. I will submit a v2 patch that includes both cgroup v1 and v2 modification. >> --- >> 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