From: Mike Kravetz <mike.kravetz@oracle.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Matthew Wilcox <willy@infradead.org>,
akpm@linux-foundation.org, mhocko@suse.com, ak@linux.intel.com,
mtk.manpages@gmail.com, Davidlohr Bueso <dbueso@suse.de>,
khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com,
aarcange@redhat.com, Mike Kravetz <mike.kravetz@oracle.com>
Subject: Re: [PATCH] mm,hugetlb: compute page_size_log properly
Date: Mon, 17 Jul 2017 15:27:58 -0700 [thread overview]
Message-ID: <1500330481-28476-1-git-send-email-mike.kravetz@oracle.com> (raw)
In-Reply-To: <20170328175408.GD7838@bombadil.infradead.org>
I hate to resurrect this thread, but I would like to add hugetlb support
to memfd_create. This is for JVM garbage collection as discussed in
this thread [1].
Adding hugetlb support to memfd_create, means that memfd_create will take
a flag something like MFD_HUGETLB. And, if a user wants hugetlb pages
they may want a huge page size different than the system default. So, it
make sense to use the same type of encoding used by mmap and shmget.
However, I would hate to copy/paste the same values used by mmap and shmget
and just give them different names. So, how about something like the
following:
1) Put all the log2 encoded huge page size definitions in a common header
file.
2) Arch specific code can use these values, or overwrite as needed.
3) All system calls using this encoding (mmap, shmget and memfd_create in
the future) will use these common values.
I have also put the shm user space definitions in the uapi file as
previously suggested by Matthew Wilcox. I did not (yet) move the
shm definitions to arch specific files as suggested by Aneesh Kumar.
[1] https://lkml.org/lkml/2017/7/6/564
Mike Kravetz (3):
mm:hugetlb: Define system call hugetlb size encodings in single file
mm: arch: Use new hugetlb size encoding definitions
mm: shm: Use new hugetlb size encoding definitions
arch/alpha/include/uapi/asm/mman.h | 14 ++++++--------
arch/mips/include/uapi/asm/mman.h | 14 ++++++--------
arch/parisc/include/uapi/asm/mman.h | 14 ++++++--------
arch/powerpc/include/uapi/asm/mman.h | 23 ++++++++++-------------
arch/x86/include/uapi/asm/mman.h | 10 ++++++++--
arch/xtensa/include/uapi/asm/mman.h | 14 ++++++--------
include/linux/shm.h | 17 -----------------
include/uapi/asm-generic/hugetlb_encode.h | 30 ++++++++++++++++++++++++++++++
include/uapi/asm-generic/mman-common.h | 6 ++++--
include/uapi/linux/shm.h | 23 +++++++++++++++++++++--
10 files changed, 97 insertions(+), 68 deletions(-)
create mode 100644 include/uapi/asm-generic/hugetlb_encode.h
--
2.7.5
next prev parent reply other threads:[~2017-07-17 22:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 17:06 [PATCH] mm,hugetlb: compute page_size_log properly Davidlohr Bueso
2017-03-08 19:39 ` Andi Kleen
2017-03-09 3:24 ` Anshuman Khandual
2017-03-09 8:55 ` Michal Hocko
2017-03-28 16:53 ` Davidlohr Bueso
2017-03-28 16:55 ` Davidlohr Bueso
2017-03-28 17:54 ` Matthew Wilcox
2017-03-29 8:06 ` Michal Hocko
2017-03-29 17:45 ` Andi Kleen
2017-03-30 6:12 ` Michal Hocko
2017-04-12 16:18 ` Davidlohr Bueso
2017-04-12 16:30 ` Andi Kleen
2017-04-12 17:21 ` Matthew Wilcox
2017-04-13 6:02 ` Aneesh Kumar K.V
2017-04-13 12:46 ` Matthew Wilcox
2017-07-17 22:27 ` Mike Kravetz [this message]
2017-07-17 22:27 ` [RFC PATCH 1/3] mm:hugetlb: Define system call hugetlb size encodings in single file Mike Kravetz
2017-07-18 0:00 ` Matthew Wilcox
2017-07-26 9:50 ` Michal Hocko
2017-07-17 22:28 ` [RFC PATCH 2/3] mm: arch: Use new hugetlb size encoding definitions Mike Kravetz
2017-07-26 9:52 ` Michal Hocko
2017-07-17 22:28 ` [RFC PATCH 3/3] mm: shm: " Mike Kravetz
2017-07-26 9:53 ` Michal Hocko
2017-07-26 10:07 ` Michal Hocko
2017-07-26 17:39 ` Mike Kravetz
2017-07-26 18:48 ` Matthew Wilcox
2017-07-27 7:50 ` Michal Hocko
2017-07-27 21:18 ` Mike Kravetz
2017-07-28 6:30 ` Michal Hocko
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=1500330481-28476-1-git-send-email-mike.kravetz@oracle.com \
--to=mike.kravetz@oracle.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dbueso@suse.de \
--cc=khandual@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mtk.manpages@gmail.com \
--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).