From: Yang Shi <yang.shi@linux.alibaba.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: viro@zeniv.linux.org.uk, nyc@holomorphy.com,
mike.kravetz@oracle.com, kirill.shutemov@linux.intel.com,
hughd@google.com, akpm@linux-foundation.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] fs: introduce ST_HUGE flag and set it to tmpfs and hugetlbfs
Date: Tue, 17 Apr 2018 16:37:11 -0700 [thread overview]
Message-ID: <6782cd11-48e5-6c12-db1c-9478ab37f77e@linux.alibaba.com> (raw)
In-Reply-To: <20180417232248.GA27631@bombadil.infradead.org>
On 4/17/18 4:22 PM, Matthew Wilcox wrote:
> On Wed, Apr 18, 2018 at 05:08:13AM +0800, Yang Shi wrote:
>> When applications use huge page on hugetlbfs, it just need check the
>> filesystem magic number, but it is not enough for tmpfs. So, introduce
>> ST_HUGE flag to statfs if super block has SB_HUGE set which indicates
>> huge page is supported on the specific filesystem.
> Hm. What's the plan for communicating support for page sizes other
> than PMD page sizes? I know ARM has several different page sizes,
> as do PA-RISC and ia64. Even x86 might support 1G page sizes through
> tmpfs one day.
For THP page size, we already have
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size exported. The
applications could read this to get the THP size. If PUD size THP
supported is added later, we can export hpage_pud_size.
Please see the below commit log for more details:
commit 49920d28781dcced10cd30cb9a938e7d045a1c94
Author: Hugh Dickins <hughd@google.com>
Date: Mon Dec 12 16:44:50 2016 -0800
mm: make transparent hugepage size public
Test programs want to know the size of a transparent hugepage. While it
is commonly the same as the size of a hugetlbfs page (shown as
Hugepagesize in /proc/meminfo), that is not always so: powerpc
implements transparent hugepages in a different way from hugetlbfs
pages, so it's coincidence when their sizes are the same; and x86 and
others can support more than one hugetlbfs page size.
Add /sys/kernel/mm/transparent_hugepage/hpage_pmd_size to show the THP
size in bytes - it's the same for Anonymous and Shmem hugepages. Call
it hpage_pmd_size (after HPAGE_PMD_SIZE) rather than hpage_size, in
case
some transparent support for pud and pgd pages is added later.
Thanks,
Yang
next prev parent reply other threads:[~2018-04-17 23:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 21:08 [RFC PATCH] fs: introduce ST_HUGE flag and set it to tmpfs and hugetlbfs Yang Shi
2018-04-17 21:31 ` Andrew Morton
2018-04-17 21:51 ` Yang Shi
2018-04-17 23:22 ` Matthew Wilcox
2018-04-17 23:37 ` Yang Shi [this message]
2018-04-18 10:27 ` Christoph Hellwig
2018-04-18 18:18 ` Yang Shi
2018-04-19 8:28 ` Christoph Hellwig
2018-04-19 9:05 ` Kirill A. Shutemov
2018-04-20 0:18 ` Yang Shi
2018-04-18 20:26 ` Mike Kravetz
2018-04-18 20:53 ` Yang Shi
2018-04-19 9:01 ` Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6782cd11-48e5-6c12-db1c-9478ab37f77e@linux.alibaba.com \
--to=yang.shi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=nyc@holomorphy.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).