From mboxrd@z Thu Jan 1 00:00:00 1970 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 71D7E817; Tue, 2 Jul 2024 00:19:12 +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=1719879556; cv=none; b=UK4jvO6PsAy/wtgR4m3Ywhg/0TCXCOhq4BwzajYE8KNG4LifX1s4rSWnG50xxLatg/1ol+QmNZ2cnuWSXqRnLpRNa5Kbpp+xDe2BvCCOhw/Zogtt2NAKCHyHFlirJmL46jX4Sm72HjelaNIfY5k0tDkW4TyZvO/pP1rAR8Uu4iw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719879556; c=relaxed/simple; bh=M+44DFQP1ah2DNL1TocHiBNwyFYryPGUnuaQ9b8Cfz0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=OAZ2F3HqQwcb8c+w/At7W1w8poqx5f7i1rXNxxFDg51WCBclNQYZ5Dp2g38L4M/4c9yccv8PyZprNB8ObBEP1DX+6gNhbwtt7fIA3bNUa59bTDolXBeI+IDMVZoIMTGoWTqSnavs5mzZkc9PBdmAuN56V8LOAGMaiLMOFKjJrPU= 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 4WCk6P648wznYls; Tue, 2 Jul 2024 08:18:53 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id 87B5C18007E; Tue, 2 Jul 2024 08:19:08 +0800 (CST) Received: from [10.67.110.112] (10.67.110.112) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 2 Jul 2024 08:19:08 +0800 Message-ID: Date: Tue, 2 Jul 2024 08:19:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH -next] cgroup/misc: Introduce misc.peak To: Randy Dunlap , , , , , , CC: , , References: <20240701125259.2611466-1-xiujianfeng@huawei.com> <047579c5-582a-46ac-8967-e9ca9a90cea7@infradead.org> Content-Language: en-US From: xiujianfeng In-Reply-To: <047579c5-582a-46ac-8967-e9ca9a90cea7@infradead.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500023.china.huawei.com (7.185.36.114) On 2024/7/1 23:01, Randy Dunlap wrote: > Hi-- > > On 7/1/24 5:52 AM, Xiu Jianfeng wrote: >> Introduce misc.peak to record the historical maximum usage of the >> resource, as in some scenarios the value of misc.max could be >> adjusted based on the peak usage of the resource. >> >> Signed-off-by: Xiu Jianfeng >> --- >> Documentation/admin-guide/cgroup-v2.rst | 9 ++++++++ >> include/linux/misc_cgroup.h | 2 ++ >> kernel/cgroup/misc.c | 29 +++++++++++++++++++++++++ >> 3 files changed, 40 insertions(+) >> >> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst >> index ae0fdb6fc618..48ae30f2d9ab 100644 >> --- a/Documentation/admin-guide/cgroup-v2.rst >> +++ b/Documentation/admin-guide/cgroup-v2.rst >> @@ -2646,6 +2646,15 @@ Miscellaneous controller provides 3 interface files. If two misc resources (res_ >> res_a 3 >> res_b 0 >> >> + misc.peak >> + A read-only flat-keyed file shown in the all cgroups. It shows > > shown in all cgroups. It shows Thanks for your review, will fix it in v2. > >> + the historical maximum usage of the resources in the cgroup and >> + its children.:: >> + >> + $ cat misc.peak >> + res_a 10 >> + res_b 8 >> + >> misc.max >> A read-write flat-keyed file shown in the non root cgroups. Allowed >> maximum usage of the resources in the cgroup and its children.:: >> diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h >> index e799b1f8d05b..8aa69818291e 100644 >> --- a/include/linux/misc_cgroup.h >> +++ b/include/linux/misc_cgroup.h >> @@ -30,11 +30,13 @@ struct misc_cg; >> /** >> * struct misc_res: Per cgroup per misc type resource >> * @max: Maximum limit on the resource. >> + * $watermark: Historical maximum usage of the resource. > > @watermark: > >> * @usage: Current usage of the resource. >> * @events: Number of times, the resource limit exceeded. >> */ >> struct misc_res { >> u64 max; >> + u64 watermark; >> atomic64_t usage; >> atomic64_t events; >> }; > >