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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F082CC30658 for ; Wed, 3 Jul 2024 02:46:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 68DB36B008C; Tue, 2 Jul 2024 22:46:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 63CFB6B0092; Tue, 2 Jul 2024 22:46:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 504C96B0093; Tue, 2 Jul 2024 22:46:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 330116B008C for ; Tue, 2 Jul 2024 22:46:06 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id D10931406E5 for ; Wed, 3 Jul 2024 02:46:05 +0000 (UTC) X-FDA: 82296901890.25.3BDA0D0 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf08.hostedemail.com (Postfix) with ESMTP id 2BB43160020 for ; Wed, 3 Jul 2024 02:46:02 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719974753; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CrEY0XuFIi3ezo6rJAprQEXLgSXKEF6s2K1nOeG6FUg=; b=z2H3e3jqsutz/QgJz6QQPuu9FojK5Tze/MSnCoUHySC8mqJMemHXC995RSeO33JED+a0LN fkkcYzEtdW7x4nrTE7K5X3Mz8/whHFfzkrdcuj/F9pIZNXwWBGCWMc+tGyaDjNwCHicIbd jlO2D+Inhcq64W21ytEwoCoCXxxVIYY= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719974753; a=rsa-sha256; cv=none; b=feMZkiAZzyCcxU0y4sxjBVOaE/1Eup5+wj4bm12NNsdvrK17HQe4BUcoLSQ1WpgFjoNNrw oYSqN+nXEqTEzaS5VkZHrEnsfRMG2LEaHA13k1O2h20bsQFsnKdhvRI3YF40/L1WwKp+vq vfA5Mz2OvByZ27tsoXrOB81IYPaTkRM= Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WDPDM6Q4szZhBq; Wed, 3 Jul 2024 10:41:23 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id EB53A1402E0; Wed, 3 Jul 2024 10:45:56 +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; Wed, 3 Jul 2024 10:45:56 +0800 Message-ID: <6843023e-3e80-0c1c-6aab-b386ffebd668@huawei.com> Date: Wed, 3 Jul 2024 10:45:56 +0800 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] mm/hugetlb_cgroup: introduce peak and rsvd.peak to v2 Content-Language: en-US To: Andrew Morton CC: , , , , , , , References: <20240702125728.2743143-1-xiujianfeng@huawei.com> <20240702185851.e85a742f3391857781368f6c@linux-foundation.org> From: xiujianfeng In-Reply-To: <20240702185851.e85a742f3391857781368f6c@linux-foundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.110.112] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500023.china.huawei.com (7.185.36.114) X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 2BB43160020 X-Stat-Signature: wwaghgx9jonhdfxa6qnugtq97ez71o74 X-HE-Tag: 1719974762-985782 X-HE-Meta: U2FsdGVkX18my+VWkLk6dJAi2V6O/E+G4fm1K6sKpOjlrazK+rQWvvBwRezPNhfIUY078r+Ac8gA0MyS0JuYb76vWbjKmGa6JL6dUdglq5GHALju85gHmiEhM3sXuxyd4fDQjEQU1IzixVK3QDGv/icbM4DrWQnblzTEXE4JSYH7PKeVe+7pP4GAC4S4rn7gJVEtUXroUvLBqPfHTeI07p9ZLamF3YMnvrsPrFkndgfyh2taAB5BGn0Vp8k9Oo2QLHXe8cJhad39yDsU0Sm6zN0mw2Qu2LTm4fyR3QxRiJDfffUIdLIXyM8QHFA+yVdPbEfM3Op/enzEIvAl5CtSlziyWBgJZEkozrPyI46WZNdn134pu/6cmVNRn7cTGNAIvTFEqjiA9Vstg1OzDYDIZ1LfyVLzh43ELvAllp4OiUXQWSqZsvfBICfLdaeaEYjJ5IArgD9urlo+IlU0ELe+CjX5ELTgmHqFyoB94dRgMuk6NwQN2wAgoRZDUi0X/ZXBbw3emuVUiEQV0M9wBlzn9HoHVHxxXomrGssMW40SSEtv7DdIc93F6N5z3Phqh35kFqsJZE3iMYR5lfsBhIOlenBsYdlXVyyZRB+K9GjcN27mjyYk5PbzZ7dM/5wYp+NRkU9THEraYYow7XgyavPrClnz7maItqoRIzo5e/MRf6idEw2gZut9181XA+1P6rlp08t3RBlbV/cHhn+4+TqDpl35xnK7CWiYU4Yj5E4NqYNv8lmIqBqe+1SrzQmZT05zZuICz3u6O1jb0rVPr3FW9Pd84RCCtV2fceclO2QTY9Hrm+Wyjt01duLjSb4++Aa8EgvUtOxOmZmAPqnEzHPWml6pU/nAiSxi46DefaseU+xJFsRpKcnvPVj+21lLOMeJrKr4ISq1Z84Ol9kC1rGzvvvO87K/WOQ9LpKEMomiAGKBFuIH40u1472lvLeTbJgy5KieyQs+wqkPTbfClav je4zekTP uIf3i+BFgarf61RsWQWhyXDnFUSasoK2jlKAsMmvAp9kciJDbr37uOMXq4hzfbtRnTUaYbbjfna8EIxOWxC+wWcP8wWqKDT1xR7y/iFk4yqWl3W1VSvf3ZWQ4XyNnErPdyByx1tyfjqelwVNOnpcW9o74OgMlyLPgfAA2MUZ/hFyGWkhmoGXpWsUqfEQU/eG/tvsqfpkeWZbEdy8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2024/7/3 9:58, Andrew Morton wrote: > On Tue, 2 Jul 2024 12:57:28 +0000 Xiu Jianfeng wrote: > >> Introduce peak and rsvd.peak to v2 to show the historical maximum >> usage of resources, as in some scenarios it is necessary to configure >> the value of max/rsvd.max based on the peak usage of resources. > > "in some scenarios it is necessary" is not a strong statement. It > would be helpful to fully describe these scenarios so that others can > better understand the value of this change. > Hi Andrew, Is the following description acceptable for you? Since HugeTLB doesn't support page reclaim, enforcing the limit at page fault time implies that, the application will get SIGBUS signal if it tries to fault in HugeTLB pages beyond its limit. Therefore the application needs to know exactly how many HugeTLB pages it uses before hand, and the sysadmin needs to make sure that there are enough available on the machine for all the users to avoid processes getting SIGBUS. When running some open-source software, it may not be possible to know the exact amount of hugetlb it consumes, so cannot correctly configure the max value. If there is a peak metric, we can run the open-source software first and then configure the max based on the peak value. In cgroup v1, the hugetlb controller provides the max_usage_in_bytes and rsvd.max_usage_in_bytes interface to display the historical maximum usage, so introduce peak and rsvd.peak to v2 to address this issue.