mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Kravetz <mike.kravetz@oracle.com>
To: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, Michal Hocko <mhocko@suse.com>,
	Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Mike Kravetz <mike.kravetz@oracle.com>
Subject: [patch] memfd_create.2: Add description of MFD_HUGETLB (hugetlbfs) support
Date: Fri, 15 Sep 2017 14:43:05 -0700	[thread overview]
Message-ID: <20170915214305.7148-1-mike.kravetz@oracle.com> (raw)

hugetlbfs support for memfd_create was recently merged by Linus and
should be in the Linux 4.14 release.  To request hugetlbfs support
a new memfd_create flag (MFD_HUGETLB) was added.

This patch documents the following commit:

commit 749df87bd7bee5a79cef073f5d032ddb2b211de8
Author: Mike Kravetz <mike.kravetz@oracle.com>
Date:   Wed Sep 6 16:24:16 2017 -0700

    mm/shmem: add hugetlbfs support to memfd_create()

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
 man2/memfd_create.2 | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/man2/memfd_create.2 b/man2/memfd_create.2
index 4dfd1bb2d..b61254bb8 100644
--- a/man2/memfd_create.2
+++ b/man2/memfd_create.2
@@ -100,6 +100,33 @@ If this flag is not set, the initial set of seals will be
 meaning that no other seals can be set on the file.
 .\" FIXME Why is the MFD_ALLOW_SEALING behavior not simply the default?
 .\" Is it worth adding some text explaining this?
+.TP
+.BR MFD_HUGETLB " (since Linux 4.14)"
+The anonymous file will be created in the hugetlbfs filesystem using
+huge pages.  See the Linux kernel source file
+.I Documentation/vm/hugetlbpage.txt
+for more information about hugetlbfs.  The hugetlbfs filesystem does
+not support file sealing operations.  Therefore, specifying both
+.B MFD_HUGETLB
+and
+.B MFD_ALLOW_SEALING
+will result in an error
+.RB (EINVAL)
+being returned.
+
+.TP
+.BR MFD_HUGE_2MB ", " MFD_HUGE_1GB ", " "..."
+Used in conjunction with
+.B MFD_HUGETLB
+to select alternative hugetlb page sizes (respectively, 2 MB, 1 GB, ...)
+on systems that support multiple hugetlb page sizes.  Definitions for known
+huge page sizes are included in the header file
+.I <sys/memfd.h>.
+
+For details on encoding huge page sizes not included in the header file,
+see the discussion of the similarly named constants in
+.BR mmap (2).
+
 .PP
 Unused bits in
 .I flags
-- 
2.13.5

             reply	other threads:[~2017-09-15 21:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-15 21:43 Mike Kravetz [this message]
2017-09-15 21:54 ` Mike Kravetz
2017-09-21 13:03 ` Michael Kerrisk (man-pages)

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=20170915214305.7148-1-mike.kravetz@oracle.com \
    --to=mike.kravetz@oracle.com \
    --cc=aarcange@redhat.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=mtk.manpages@gmail.com \
    /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

all inboxes | Powered by JetHome®