From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: aneesh.kumar@linux.vnet.ibm.com, mpe@ellerman.id.au,
christophe.leroy@c-s.fr
Subject: [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
Date: Fri, 7 Apr 2017 09:25:39 +0530 [thread overview]
Message-ID: <20170407035539.21688-1-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <5fb76b92-2988-1207-2bed-814a96e6a51a@linux.vnet.ibm.com>
This just adds user space exported ABI definitions for 2MB, 16MB, 1GB,
16GB non default huge page sizes to be used with mmap() system call.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
These defined values will be used along with MAP_HUGETLB while calling
mmap() system call if the desired HugeTLB page size is not the default
one. Follows similar definitions present in x86.
arch/x86/include/uapi/asm/mman.h:#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT)
arch/x86/include/uapi/asm/mman.h:#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT)
Changes in V4:
- Added defines for 512KB and 8MB HugeTLB page sizes per Christophe
Changes in V3:
- Added comment about how these defines will help create 'flags'
argument for mmap() system call per Balbir
Changes in V2:
- Added definitions for 2MB and 1GB HugeTLB pages per Aneesh
arch/powerpc/include/uapi/asm/mman.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
index 03c06ba..ebe99c7 100644
--- a/arch/powerpc/include/uapi/asm/mman.h
+++ b/arch/powerpc/include/uapi/asm/mman.h
@@ -29,4 +29,18 @@
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
+/*
+ * These constant defines should be used for creating the
+ * 'flags' argument (26:31 bit positions) for mmap() system
+ * call should the caller decide to use non default HugeTLB
+ * page size.
+ */
+#define MAP_HUGE_512KB (19 << MAP_HUGE_SHIFT) /* 512KB HugeTLB Page */
+#define MAP_HUGE_1MB (20 << MAP_HUGE_SHIFT) /* 1MB HugeTLB Page */
+#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) /* 2MB HugeTLB Page */
+#define MAP_HUGE_8MB (23 << MAP_HUGE_SHIFT) /* 8MB HugeTLB Page */
+#define MAP_HUGE_16MB (24 << MAP_HUGE_SHIFT) /* 16MB HugeTLB Page */
+#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) /* 1GB HugeTLB Page */
+#define MAP_HUGE_16GB (34 << MAP_HUGE_SHIFT) /* 16GB HugeTLB Page */
+
#endif /* _UAPI_ASM_POWERPC_MMAN_H */
--
1.8.5.2
next prev parent reply other threads:[~2017-04-07 3:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 6:03 [PATCH] powerpc/hugetlb: Add ABI defines for MAP_HUGE_16MB and MAP_HUGE_16GB Anshuman Khandual
2017-04-04 8:33 ` Aneesh Kumar K.V
2017-04-04 13:50 ` Anshuman Khandual
2017-04-05 5:19 ` [PATCH V2] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes Anshuman Khandual
2017-04-05 6:59 ` Balbir Singh
2017-04-05 7:09 ` Michael Ellerman
2017-04-05 11:20 ` [PATCH V3] " Anshuman Khandual
2017-04-06 19:03 ` LEROY Christophe
2017-04-07 3:47 ` Anshuman Khandual
2017-04-07 3:55 ` Anshuman Khandual [this message]
2017-04-07 13:01 ` [PATCH V4] " Michael Ellerman
2017-04-07 14:58 ` Anshuman Khandual
2017-04-07 15:44 ` Paul Clarke
2017-04-08 9:19 ` Michael Ellerman
2017-04-10 22:49 ` [V4] " Michael Ellerman
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=20170407035539.21688-1-khandual@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=christophe.leroy@c-s.fr \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.