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 8D0F8C3271E for ; Mon, 8 Jul 2024 13:40:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 219266B0095; Mon, 8 Jul 2024 09:40:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C9856B0098; Mon, 8 Jul 2024 09:40:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 091816B0099; Mon, 8 Jul 2024 09:40:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DF5F76B0095 for ; Mon, 8 Jul 2024 09:40:52 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1950E1412A3 for ; Mon, 8 Jul 2024 13:40:52 +0000 (UTC) X-FDA: 82316695944.25.1E03CBF Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf13.hostedemail.com (Postfix) with ESMTP id 0D7C420023 for ; Mon, 8 Jul 2024 13:40:47 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.189 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=1720446034; 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=jqY/NPlfez7kEAY0aPzI6/rxG/vvkqKN5CQH7d+T1GY=; b=6wlJr2S7ng44riXfukjdOW9vBgFoLWDGSVfcfiIFqKwXmbL0+3VfYz/SqbscgzIk2kIsWJ T3ruZSuPzVtmVD1t0VVuFJDzGOsOcLQHQ20Qb/Fa4ajZ5hn0W3jc/achcPmGbIiqx7HHfz nzFQoPAyNhsU25aql4v/b8ODqf7uFcM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.189 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=1720446034; a=rsa-sha256; cv=none; b=iQPS5CNbu/FB+A9ESvdEVXZTEmxgkNAIsmMuXFhHd5yJqJdS2CR/1MAZWwHo+qcSa6/c1Q ap/DHKzdwjltP9mXzVmDiaGYzO274FuVMdmFm3cCbuNhWYXFwq31Ws62+X6FX02BlficO8 olQqNkr6kWESs8TsRILe7++F6GsghhE= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WHlXG2MTbzQkvM; Mon, 8 Jul 2024 21:36:46 +0800 (CST) Received: from dggpeml500023.china.huawei.com (unknown [7.185.36.114]) by mail.maildlp.com (Postfix) with ESMTPS id 18ABB140156; Mon, 8 Jul 2024 21:40:40 +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; Mon, 8 Jul 2024 21:40:39 +0800 Message-ID: <5ce7be39-ac42-98c9-65fc-589385b8f65b@huawei.com> Date: Mon, 8 Jul 2024 21:40:39 +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 To: Michal Hocko , Andrew Morton CC: , , , , , , , , Sidhartha Kumar , Miaohe Lin , Baolin Wang References: <20240702125728.2743143-1-xiujianfeng@huawei.com> <20240702185851.e85a742f3391857781368f6c@linux-foundation.org> <6843023e-3e80-0c1c-6aab-b386ffebd668@huawei.com> <20240703133804.1d8ddf90f738a7d546399b3b@linux-foundation.org> Content-Language: en-US From: xiujianfeng In-Reply-To: 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-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0D7C420023 X-Stat-Signature: 6z5c44y69xjuadppqepkfemahqwp1oxr X-Rspam-User: X-HE-Tag: 1720446047-817990 X-HE-Meta: U2FsdGVkX19U4+IFPggehhwXs2bUDSxNb8AXQ4NzfhKO5dDodaqKkCg0/llPhJKCkbQVAohgPJaCO+SU6/ppw/6CvIpzaIxwHiF8WYtxagJl6jqKrGV562x6vJZohEZa1oogvUcFaflb8l8GxNzG7u9ak2SVA2fZzKQi9EShVtvwd7UVEHlyXWOfPUZwFy8tQiX/pNGD0gDNxZbI+9V7FNtVJBF+nK71//9wGsC+6p3CbLj1QHtpvHUovTXu4hffoGGWeGwdaHm9lISIGZV419B/5E9Jkv3FY8zQZqhZg3b1LBA5C37SsUeAhWPPqxdTR5tm0/AR7Podo73zPo1eEf5qvTZJqpd6ijtQuJmmQZToLyy2IJrJBwhxvkwg60r51vCHfQ+bi6C/Db0VO0XS/eqJw4K2RMVjFb8dWIij4H8G7Z+5yy/tY3fwKK1VPceWlNOPrEJnad2TeeW/Srs2I3rkPa1JVUOdMNn+RJjGL2k3LtOXLHbW0kuHn4EWpbFkxHUX92/BupthQzhrgm7OXI70cGzC/kUfjQtQYFxCmcEiQtJwiHLaFumbHYMybU807Dxl4hHbX4avp/JYCFBqC92EabMdcFNWEiMWBjcDimMLwp9fI9Ww48qFl9l3/BzWGSq1GHvgXfR2LDFOUOGQF/Aqxcm8xhrKt4UP8QBAZcniXodYkbNou/PajZYdhhXCkflBAyp+d+Slo2xAbJm7aF8p0f7VJ9J3ZcyetJQNCu74o6wG3WZUW1bQZxYBqCrESfxfmXrsROdaMEj3ILqcemn4cheG57UZ5WBIh31UW+On0zF7UAB11XIPQ+SN9+jIFQm1nFG5i2IM9nGK7E2d/cShULvKJaUcbUE2C46mPzi1fJLSo0IhRV1/2DaTrv2G3agUFXwpZ+h7ZzqKry1dWEw0Z+RRQUSH3MtkhtMwAtqE9PG4oVHQAj+Cbd8+y/GWrIMeoCiRBjsPQVfm6XB 0aizUCyd IXIzdQXkYll6WZMmGx1AxTjcrj7u9ukTX5QuOqHdA/0VSU09gsGX8AdPQ1VFOouzoDpY8OHsDiI0bx68w7WmIxIwlqUMKx/1y8dCi3KfQf+rYZRyyftdCSeca1Yxg1Ah/waErBmp1XO036C+iXj57wpEnRWD40yw19FWIrSLNTIZSaL6PVJWO4cOTWAMCknKB/ZWJKAwT+h5svJQ= 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/8 20:48, Michal Hocko wrote: > On Wed 03-07-24 13:38:04, Andrew Morton wrote: >> On Wed, 3 Jul 2024 10:45:56 +0800 xiujianfeng wrote: >> >>> >>> >>> 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. > > yes, this is pretty much a definition of hugetlb. > >>> 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. > > I would push back on this. Hugetlb workloads pretty much require to know > the number of hugetlb pages ahead of time. Because you need to > preallocate them for the global hugetlb pool. What I am really missing > in the above justification is an explanation of how come you know how to > configure the global pool but you do not know that for a particular > cgroup. How exactly do you configure the global pool then? Yes, in this scenario, it's indeed challenging to determine the appropriate size for the global pool. Therefore, a feasible approach is to initially configure a larger value. Once the software is running within the container successfully, the maximum value for the container and the size of the system's global pool can be determined based on the peak value, otherwise, increase the size of the global pool and try again. so I believe the peak metric is useful for this scenario.