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 X-Spam-Level: X-Spam-Status: No, score=-19.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B0ADC4338F for ; Mon, 16 Aug 2021 23:28:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A480960F4B for ; Mon, 16 Aug 2021 23:28:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A480960F4B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 41FAC6B0073; Mon, 16 Aug 2021 19:28:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CF856B0074; Mon, 16 Aug 2021 19:28:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E5B58D0001; Mon, 16 Aug 2021 19:28:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 1514B6B0073 for ; Mon, 16 Aug 2021 19:28:34 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B623F8249980 for ; Mon, 16 Aug 2021 23:28:33 +0000 (UTC) X-FDA: 78482535306.11.1755EF6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP id 4AE32F00BEC8 for ; Mon, 16 Aug 2021 23:28:33 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2FEF5606A5; Mon, 16 Aug 2021 23:28:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1629156512; bh=4n+RmyA6BCpELUNEjamrhEqJy00J6bq1EviW19Mc8Cw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=io5zJdg0Gnv6RmMsQ/i/nwLZG/PncP4vWbOa6puoskHUXiDVZmtjNeoM9FxrAJ+ad 8FQ3f/3rxxIbjeapMsnL1IWOu02UF0z9LUPKscxM69YbPCkfjuGiXi8FPi3Vfwkp2t Q6f4KxSbPmgsUJ5WUw8QK6wSJgBMLpSUq5g8Kutk= Date: Mon, 16 Aug 2021 16:28:29 -0700 From: Andrew Morton To: Mike Kravetz Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand , Michal Hocko , Oscar Salvador , Zi Yan , Muchun Song , Naoya Horiguchi , David Rientjes Subject: Re: [PATCH 5/8] hugetlb: document the demote sysfs interfaces Message-Id: <20210816162829.a228c4629b411900702b7f5f@linux-foundation.org> In-Reply-To: <20210816224953.157796-6-mike.kravetz@oracle.com> References: <20210816224953.157796-1-mike.kravetz@oracle.com> <20210816224953.157796-6-mike.kravetz@oracle.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4AE32F00BEC8 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=io5zJdg0; dmarc=none; spf=pass (imf16.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam04 X-Stat-Signature: dy6szt5pi7bwmjr1dfh6qc14akh4gbwy X-HE-Tag: 1629156513-473706 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: On Mon, 16 Aug 2021 15:49:50 -0700 Mike Kravetz wrote: > Describe demote and demote_size interfaces. > > Signed-off-by: Mike Kravetz > --- > Documentation/admin-guide/mm/hugetlbpage.rst | 29 ++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/Documentation/admin-guide/mm/hugetlbpage.rst b/Documentation/admin-guide/mm/hugetlbpage.rst > index 8abaeb144e44..902059a0257b 100644 > --- a/Documentation/admin-guide/mm/hugetlbpage.rst > +++ b/Documentation/admin-guide/mm/hugetlbpage.rst > @@ -234,8 +234,12 @@ will exist, of the form:: > > hugepages-${size}kB > > -Inside each of these directories, the same set of files will exist:: > +Inside each of these directories, the set of files contained in ``/proc`` > +will exist. In addition, two additional interfaces for demoting huge > +pages will exist:: > > + demote > + demote_size > nr_hugepages > nr_hugepages_mempolicy > nr_overcommit_hugepages > @@ -243,7 +247,28 @@ Inside each of these directories, the same set of files will exist:: > resv_hugepages > surplus_hugepages > > -which function as described above for the default huge page-sized case. > +The demote interfaces provide the ability to split a huge page into > +smaller huge pages. For example, the x86 architecture supports both > +1GB and 2MB huge pages sizes. A 1GB huge page can be split into 512 > +2MB huge pages. The demote interfaces are: > + > +demote_size > + is the size of demoted pages. When a page is demoted a corresponding > + number of huge pages of demote_size will be created. For huge pages > + of the smallest supported size (2MB on x86), demote_size will be the > + system page size (PAGE_SIZE). If demote_size is the system page size > + then demoting a page will simply free the huge page. demote_size is > + a read only interface. > + > +demote > + is used to demote a number of huge pages. A user with root privileges > + can write to this file. It may not be possible to demote the > + requested number of huge pages. To determine how many pages were > + actually demoted, compare the value of nr_hugepages before and after > + writing to the demote interface. demote is a write only interface. > + > +The interfaces which are the same as in ``/proc`` function as described > +above for the default huge page-sized case. Are these new demote interfaces duplicated in /proc? Documentation/admin-guide/mm/hugetlbpage.rst says "The ``/proc`` interfaces discussed above have been retained for backwards compatibility.", so new interfaces need not appear in /proc?