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 59E01C2BD09 for ; Wed, 3 Jul 2024 20:38:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C068E6B0082; Wed, 3 Jul 2024 16:38:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B67486B0089; Wed, 3 Jul 2024 16:38:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E0DC6B008A; Wed, 3 Jul 2024 16:38:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 77C3B6B0082 for ; Wed, 3 Jul 2024 16:38:10 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EE67CA3843 for ; Wed, 3 Jul 2024 20:38:09 +0000 (UTC) X-FDA: 82299603498.11.509FAB4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 4A90E4000F for ; Wed, 3 Jul 2024 20:38:07 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=UJwRVIXd; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720039063; 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:dkim-signature; bh=5ZKToPupGoYBUG2rVK+/w0eYKiCCBZRzWphsyvHiY+c=; b=OfUbVMuk1pfRWwbuwCELe+8JnpJZlXwgMUx2wbRV5wSjjAgWgr0lhX8g7w2ElL+iPYZVE3 l4alxgWGBdQWdo2Zl9lYpKta91+EYOg2Ue31NPhqC08riGHwB2FSGXWrIam5L96DktY/jS sgxW0DwnZ4ATxhmlufdUd5ZWCukGzWo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720039063; a=rsa-sha256; cv=none; b=wspovnZnQFNZGddmEs8r4Hy1lQOqUyhVjsb7KBJKQkl+FNs2/PSW6eNVyTVmvdhwlag+S0 i9lKPkdQlCsmDX3DfLyVh569/0HSoqN9TnC53E8dlqiU0ygOMnjWE/r1RG/XiBUdt0inru U0zurB0tZGOOpye1ZGf+rf7x51n+tnc= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=UJwRVIXd; spf=pass (imf27.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2626C619D9; Wed, 3 Jul 2024 20:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 662BDC2BD10; Wed, 3 Jul 2024 20:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1720039085; bh=+4Ks35xAf/yZ+g6UF74Pf5H+mbGc4Y8ntl+6RsPGyps=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UJwRVIXdlKeVTnmQs9Qv9fgIH8QA7Cxi3P0TeMwE5JD2MhfR5HEgkmrBN8wJS7zUy DqY6Zz7Epo6y7LFeQw4E8StHutlFYDvqvWOUsz0WRp2LDN7MUzZRlahzHbS7nWM7+u N964EPbT4uJ0ubCmlZK5jS8MAEULJN5UyvkYQAFU= Date: Wed, 3 Jul 2024 13:38:04 -0700 From: Andrew Morton To: xiujianfeng Cc: , , , , , , , , Sidhartha Kumar , Miaohe Lin , Baolin Wang Subject: Re: [PATCH -next] mm/hugetlb_cgroup: introduce peak and rsvd.peak to v2 Message-Id: <20240703133804.1d8ddf90f738a7d546399b3b@linux-foundation.org> In-Reply-To: <6843023e-3e80-0c1c-6aab-b386ffebd668@huawei.com> References: <20240702125728.2743143-1-xiujianfeng@huawei.com> <20240702185851.e85a742f3391857781368f6c@linux-foundation.org> <6843023e-3e80-0c1c-6aab-b386ffebd668@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 4A90E4000F X-Stat-Signature: i6qggzmg753at61epokcs3opp1ycdt4d X-HE-Tag: 1720039087-15155 X-HE-Meta: U2FsdGVkX19gdQx0FI1uA/VKBoHzOMzw2B0db/136ETx2HGANz+4I4gggfmzu/IwFSvdqQkOmWNuR37Vu2Vm2n3a2u6vfVxyD4FbRkrVzSryAnyu9flFDhZHowJ1m99hyZ1U1Q+8dajRVuwLTCjV7J4Ig1nPG6zS/k/bQFvRzWWZ6xzdAr1cUHg5O+US3Tao74GOdTBt8PllcGTnnRTrfcddJFw5aKrE1uIHeYTKZ8XKglKRxCJeDKeZO0udIAmdlC+vxC+U+9xN5BikkVFHc26sGmnYiiYIegmWZGfazNZI2N2U6ixusXbU5/WGubBJTScXFIrk7QVVcZFigR3GfgQToXY4zVFcrlgcHT0rr7eqEV3X8WnuUnhHc476KYxAIRwDg5kDHpmXnHDsi3PEyChXN7cLujN85I+RBKvtlHFJp9yfJXuI9z/XfN3XncOdwsApJncHhzlSlsyhRI/OD+wsViFRiUGUcdyWBQ+4duCMQ5cOq/7RkMVk5bF4hR5l3oKw3zPJMy2/MCTnnq1neYv8CLKW+arMVkJr605Et3UqjbG/PbEq+UfbBu9qiWLdHPJb9jY+lKkK/4peXzaDxIWEHKBSrujTmcs2wCDCNWEZDVrgXnIA63iLFNFTKAsHdTiTsbKyEpREN5NC2iDzA4EMfEQgXjHr2BAVfwzp7v/2PoRuBuvJpcI3i49RDfCVII0t0/ix2SHo/j9O2UqsFXykbALKkVh3b4sIFTqA+Ub+EEGIRvoZW1dvp6pRtMcnqad1ym3kHRLqmUmm0/5dXm5isaj0gsCtOrEmtouNbdvI0MSklfiGK9zoc7GhQFmQue0rGQUIqDRb/KKJL8X6jPrDJD3IJ2nh7sK00ppwPaLX/+/Q7asyN1sH3zJc0Ujr0VqQY9hSWGDjq+bdoxPtsVU6iKbvsxu1ZraZFs+ZzNEOl8I5aOBLDpZ441mU95UOEnv/z4Oyc7qeymXCitt wHT2nIk+ hA1ISVYwYhbXxdl7Qg1yoI0E6rg3tS3Ik2wED6NMQ48LlYfS2yzS99UJ9QxK5LIbjgHh/51pRMSWT7yq8MT0FgwUHxb0gNceF/F1La0Om+1QE9i0uLRueHyIdEMhcro6J4Dkho0MjjZPV6oJrDGYl/yvqP2TSu2/9qf9CLZqqKhcLXWxpsRoS2aLBoSRD4LfojDvkclg1fyOox9HuTHjip1pin84nqtlAk2V+NY6vfP924htwVltw/Mv0dml6iMDUWoBcTq+1IOesy/+DWTjWW3LMa1DNpYAvXEw+dhe1InKPAS8= 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 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. > > 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. Super, thanks for doing this. It's getting late in the cycle, but the patch is simple so I'll add it to mm-unstable for additional exposure. Hopefully some others can offer their thoughts on the desirability of this.