Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp291793lqb; Tue, 28 May 2024 16:10:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWoMMKFTPicb4auUuXJ+K4FdDOxR7IEkAXZelBzdBb8S/ckmMrY4TLUL6+ijc5Tn/gUCznQ1YjEBKZsdq6DlV8OkF1tsle/KmkM9+YSvQ== X-Google-Smtp-Source: AGHT+IEurWkpSNwVoWeLTNN/eweUkTJ1w00kJ5n3ncxfmQs69lGmaYSCY8tpWU87GsOnfhBkxPzz X-Received: by 2002:a05:6830:2044:b0:6ee:360e:e11d with SMTP id 46e09a7af769-6f8d0b4dddcmr13006743a34.35.1716937854814; Tue, 28 May 2024 16:10:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716937854; cv=pass; d=google.com; s=arc-20160816; b=0wsl4/dXa7+Jp2qbnIs0u76ukMYqcge6Thpsmta/5Q3PpPmUuVZcvtq5k1PsnbcgP4 BppROjEJq4AgFwOVAKbXAHsLu1sVbmTfzUyp1iNceNjnoxWZ53CFRFPoLL+3uGyj+dpk 1L7FBa5iF9jSNZOsnckD1qbfV1xgfomfAer4aSNxzaUgGj1C4eL09Q2OV8qy23MxBdbC JMYOFDP7/x9d3CWfBWvFusbHL7B/yRd/r8IiFtd5Nmb3aAoPb9WeAHRkzN+orXRM5OtB m0srcfqF2z8ZS8sKR5iiRNTKhqNlyQE8jVpMfvIPV7ZXxQ1rgTfNt0lDF/JHNmiExKWK 9F8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=2C26c1X2kl1AKGaQVpyxNVw+ZiIYNnX/HN9VLb5bOBQ=; fh=4FrgQBFUiHYK6ITzIfyKKDQOZ1oYKIOuA+NxjLPl3Z0=; b=oLSluKi7jzszEQuMi3/j/V+P6Jz0hQXlPawVWw6qB7dUd/gNGAGqxNXn4uV3yXDQb3 mkgh8biDntzgYYnpXys15T43zAOJQoXp/S/O92AQZtiDAsBTKYCSw38id4qMPjejqxJ/ M4NmLVw88fEa+imWRAKKACuaxhIDny83zGPGspA5aihktUA5bhm9xOQh0Ss1298I38Eu CAWAaKDRhZ75CMoftvCOnAO0IOKcHqZqCTpX7qQuYmfexEORKvBeZRwaEgAfPsgsIiZE 4tHTDg+PS3esibmegs4w94P8CKTiKFdLiSOtkK19GhZcMDYsPbuwLZkm+nFFeCYFx4xM b15g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=J9W+MGRl; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-193221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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-43fb18a6e44si112884681cf.357.2024.05.28.16.10.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 16:10:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193221-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; dkim=pass header.i=@google.com header.s=20230601 header.b=J9W+MGRl; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-193221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193221-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 876F21C23051 for ; Tue, 28 May 2024 23:10:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D513513E8BD; Tue, 28 May 2024 23:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="J9W+MGRl" Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A280017C6A for ; Tue, 28 May 2024 23:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716937849; cv=none; b=Z+Xxs4do+vcdhbvd2opUP28wthSDl1kzrl0aAg2Em43SpyCFIP/AjL4dbDgXDTdmgkMWZilHxC55bvaINg5cAClOI5eHxMFeMj1aV08zX/JQwDJlPBVrIHJ1Zi/EhjM6MU9PEVV80Xdqy8Bo9AwWnyQJ9MFFakpEp2kF2gTtuAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716937849; c=relaxed/simple; bh=DDnCwgBkD0IE3CqaY1N4KkL1lU4fNU2djZKuJ+qHwKQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=iPVC0r5oTwwCoQ2TWG1v+9vIgmw51vo6de/rjrIx2fx1HHc1ic7Wl6S9QJweeu79qeReZgPDrdKF5uLdDWoer4Bu69v58rbAhorftajPi1Tks5+1mDMdibfgssSchn9/7mo88vnKJMIOT0jm6swfMjEpndmY0FL5I2QnftAvHjo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=J9W+MGRl; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1ee5f3123d8so31055ad.1 for ; Tue, 28 May 2024 16:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1716937847; x=1717542647; darn=vger.kernel.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2C26c1X2kl1AKGaQVpyxNVw+ZiIYNnX/HN9VLb5bOBQ=; b=J9W+MGRl+qN6JUO0/D2sKdhn8lqP1JSpPj58SV30goXP2LzqgCQ0vK1yurwIsN2ZS9 Aa+pNGS1e2df6HiDI3whc2+SuLd05mvTtGPUyFJieQvD2ptdK5nGkRAM5JYpEwniBT84 NVd0eJTEDtLOTKBl33HTjkc/n2JZZefZNK5G5/Ki0hM/kDh86DXpGoV7OSIEkXZcR3PJ 73GRdNeuyx2LVZ/+Fwv5bToYAt/WuKTan55OVJywqR6P4gtrpUyuGYtsNdBoZC3F9YDC WbeIkq+8Qj6uen1QRXACkoGQS/qbKCGlvVvbq8hkrCxdtIpkmPy/9qMYiI9LFNDUZGFs Rqvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716937847; x=1717542647; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2C26c1X2kl1AKGaQVpyxNVw+ZiIYNnX/HN9VLb5bOBQ=; b=iuqRVx0bWMAWf08H/ffixikYPb/jq1kD7JI6kiX7aQRFo/Q5F6kB/ISGX8jDieDSC7 e4QuVjSiMKjJuzJ6Cyr6DVQ83fTmfTOqVEZIDYfMmguctFhwpvMXA6h13HvIVm4/GNGl caRavZ0nCK6Rev0E138je2yL2FiMZEpeZZkGaVKdNgmlP54u3YZhPRoYRMPXEwL/Colh pBczFXPnftP0RPwjnYYX7UIkE0uEVUbeM8/zUVDJgn2JzgSmH7oad3bavXv/ikYPNBOk taSVX93JuvW4lcMubq6KEY9CWi+/M7Z8NMp3X6WG14+hvq35oQgtiT9cv8CiZ8mV/sYo wSbw== X-Forwarded-Encrypted: i=1; AJvYcCXxwkdDeuvmGLViFH1NoiFy7be3P+rJLWOZtRa99Kkp2zg6SUJJwlOhOfyy1gWw1OUIrkP6uZL0ma97Eju7wW2/qLUZxI1SuxXRhjY3 X-Gm-Message-State: AOJu0YwxarKDEQUOiavkRSLI5ywN/tA6/RvtEOpofPL09+XdB/lkOTBw C74zL1E34N4J0WaAhUVq0F//XYwwFl86Z1zMvMdhPZlJI6t+mls38al0IAoJjA== X-Received: by 2002:a17:902:8493:b0:1f3:50cc:43a2 with SMTP id d9443c01a7336-1f4e95e11c5mr759225ad.24.1716937846630; Tue, 28 May 2024 16:10:46 -0700 (PDT) Received: from bsegall-glaptop.localhost (c-73-202-176-14.hsd1.ca.comcast.net. [73.202.176.14]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c7cc01esm85899035ad.112.2024.05.28.16.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 16:10:46 -0700 (PDT) From: Benjamin Segall To: Cheng Yu Cc: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH 2/2] sched/fair: set burst to zero when set max to cpu.max In-Reply-To: <20240522031007.643498-3-serein.chengyu@huawei.com> (Cheng Yu's message of "Wed, 22 May 2024 11:10:07 +0800") References: <20240522031007.643498-1-serein.chengyu@huawei.com> <20240522031007.643498-3-serein.chengyu@huawei.com> Date: Tue, 28 May 2024 16:10:42 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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 > --- > 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