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 BC7FAC36010 for ; Fri, 4 Apr 2025 16:31:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEF6C6B0006; Fri, 4 Apr 2025 12:31:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9FE56B0007; Fri, 4 Apr 2025 12:31:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D65456B0008; Fri, 4 Apr 2025 12:31:33 -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 B9B066B0006 for ; Fri, 4 Apr 2025 12:31:33 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 715858055C for ; Fri, 4 Apr 2025 16:31:33 +0000 (UTC) X-FDA: 83296902066.08.185E09B Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by imf01.hostedemail.com (Postfix) with ESMTP id 1FEB24000E for ; Fri, 4 Apr 2025 16:31:30 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=YDseWwgp; spf=pass (imf01.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.152 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743784291; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fjwud8ak6+xfC04y1eWrvVdmASw0v1ZoTEzAJrACWAo=; b=8U70iGHaz5wdYZu4cnTu0L7vChcHTrLEJOBJgWrmypBhOnTBd24WQImm3ADgFQILye3PqG ubhknYekXiyfxj/3h1LFt+IsS2mnS/OUVj0wmgCWvlj0cHZEENcOmnEtle+8rAEdIWLrNt C2uxLaSkGPfnYVOUMjZD/fY2f3gJH5s= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=pankajraghav.com header.s=MBO0001 header.b=YDseWwgp; spf=pass (imf01.hostedemail.com: domain of kernel@pankajraghav.com designates 80.241.56.152 as permitted sender) smtp.mailfrom=kernel@pankajraghav.com; dmarc=pass (policy=quarantine) header.from=pankajraghav.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743784291; a=rsa-sha256; cv=none; b=rr9Q28opfncRZ+duvDYrcruOH7LDWCSHjlmN+RqkzTHNCoUivSqrFkV+c+bwXhbg9HT6rR KPPk6lyT6NSLzaJyPEJ5oljwUfv8zzmABmriWMVM4dhEo/eRPi+ClPhvQB2eVNLCMp2DAG 9KV9QIUkTHa5AANtEcrxPtSVRm5vAcI= Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4ZTkdB1w5Cz9slr; Fri, 4 Apr 2025 18:31:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1743784286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fjwud8ak6+xfC04y1eWrvVdmASw0v1ZoTEzAJrACWAo=; b=YDseWwgp4DPdW+9UfcNzBwdjuUPiX9bS881tFQiODJY1V1Cqp1NwQfkP+TSOkudURmJ/qB 1wtFGHU8INphOGB+e4bplll0ucaGwH5dAG+FhV2+O9gAxqEGWaGuo+l5l2viNqmDgW/noc Z6pNvEsR6P5zuMgBQY9gjRumtzqYxVjA3vA6+ccMQDhM1DfyM3tjwQYgVTFA+Z3I67EPg5 kY9spDYtP7en+7eXOIPhIs5Dt5b2BwHinClNA1BMyCezvryIDTZLCq4HBEYnxz8GUFieFW nrq05PLgW2WrEeni5iHRARJDppH4Nmdf+ZhmPCOsNb1THvDg00LkQY3CjaQ9dg== Date: Fri, 4 Apr 2025 18:31:16 +0200 From: "Pankaj Raghav (Samsung)" To: Luis Chamberlain Cc: Andrew Morton , Jonathan Corbet , linux-kernel@vger.kernel.org, willy@infradead.org, linux-mm@kvack.org, Bagas Sanjaya , David Hildenbrand , da.gomez@kernel.org, gost.dev@samsung.com, linux-doc@vger.kernel.org, Pankaj Raghav Subject: Re: [PATCH v3] docs: update THP admin guide about non-tmpfs filesystem support Message-ID: References: <20250404140657.29285-1-kernel@pankajraghav.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1FEB24000E X-Stat-Signature: ymd4tonn5fdhj45sbgajcnun5z5j5f8h X-HE-Tag: 1743784290-866235 X-HE-Meta: U2FsdGVkX1/6wD05fRx+1x39vQLe2YKTiIV56QZl2zloEBpOBNCXrClaWAd4UwsBEpaHTK0ZSDw017k5WwKXKdeqk7J/0rP4imroRF29kh5w31kRuiviWEzA9g9WHAa/jNJTzbzpKlHSE7UTcJE4yiEcDSpjRHGdJYrXIc30qc5zxE90mEbru1dJRJoMntTeeA49vdYZahFvSL0DlKISYaGttrM8iFJr1/ZUNgy3Q9pav43nqLaz1MXhtzPKCqRLa8anr2xYv6mYHgXaEl8oK7X8hL3SA2u/L+1jyjooyK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ity: 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 Fri, Apr 04, 2025 at 08:32:15AM -0700, Luis Chamberlain wrote: > On Fri, Apr 04, 2025 at 04:06:57PM +0200, Pankaj Raghav (Samsung) wrote: > > From: Pankaj Raghav > > > > THP support for non-tmpfs filesystem has been around for some time now. > > Update the admin guide to reflect it. > > > > While we are at it, move FilePmdMapped to previous paragraph for clarity, > > and clarify ShmemPmdMapped & ShmemHugePage. > > > > Signed-off-by: Pankaj Raghav > > Acked-by: David Hildenbrand > > --- > > > > Changes since v2: > > - Address comment from Bagas Sanjaya > > - Squash commits and Ack from David > > > > Documentation/admin-guide/mm/transhuge.rst | 22 +++++++++++++++------- > > 1 file changed, 15 insertions(+), 7 deletions(-) > > > > diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst > > index dff8d5985f0f..f8aae64e38d0 100644 > > --- a/Documentation/admin-guide/mm/transhuge.rst > > +++ b/Documentation/admin-guide/mm/transhuge.rst > > @@ -12,8 +12,8 @@ using huge pages for the backing of virtual memory with huge pages > > that supports the automatic promotion and demotion of page sizes and > > without the shortcomings of hugetlbfs. > > > > -Currently THP only works for anonymous memory mappings and tmpfs/shmem. > > -But in the future it can expand to other filesystems. > > +Currently, THP only works for anonymous memory mappings, tmpfs/shmem and > > +filesystems that support large folios. > > That seems to allude that THP can be supported on filesystems > that suppor large folios. I don't think we want to call that THP But we do allocate a THP in the page cache if we support large folios. See [1] where THP was supported through page cache. From what I understand, THP support was added first to the page cache and then large folios (orders in between) support came later. For example, you can mount XFS and do a simple dd as follows: $ dd if=/dev/random of=/mnt/hello bs=1G count=2 And if you monitor `FileHugePages` after dd is done, it would have filled up if THP is enabled. > and that can confuse folks. Leaving "currently" also seems to > indicate that there is more work to be done for THP for filesystems > but that's not true as well. So how about something like: There is more work to be done in the filesystems right? Adding large folio support is the prerequisite here to get the THP support. > > THP only works for anonymous memory mappings, and the tmpfs/shmem is the only > filesystem to support it. The alternative to THP for other filesystems is to > support large folios and with it you can end up using huge pages > opportunistically. > > Luis [1] https://lore.kernel.org/linux-mm/20201029193405.29125-1-willy@infradead.org/ -- Pankaj