diff mbox

powerpc/hugetlb: Add ABI defines for MAP_HUGE_16MB and MAP_HUGE_16GB

Message ID 20170404060310.7588-1-khandual@linux.vnet.ibm.com (mailing list archive)
State Superseded
Headers show

Commit Message

Anshuman Khandual April 4, 2017, 6:03 a.m. UTC
This just adds user space exported ABI definitions for both 16MB and
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)

 arch/powerpc/include/uapi/asm/mman.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Aneesh Kumar K.V April 4, 2017, 8:33 a.m. UTC | #1
On Tuesday 04 April 2017 11:33 AM, Anshuman Khandual wrote:
> This just adds user space exported ABI definitions for both 16MB and
> 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)
>
>  arch/powerpc/include/uapi/asm/mman.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
> index 03c06ba..e78980b 100644
> --- a/arch/powerpc/include/uapi/asm/mman.h
> +++ b/arch/powerpc/include/uapi/asm/mman.h
> @@ -29,4 +29,7 @@
>  #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 */
>
> +#define MAP_HUGE_16MB	(24 << MAP_HUGE_SHIFT)	/* 16MB HugeTLB Page */
> +#define MAP_HUGE_16GB	(34 << MAP_HUGE_SHIFT)	/* 16GB HugeTLB Page */
> +
>  #endif /* _UAPI_ASM_POWERPC_MMAN_H */
>

I am doing a similar patch as part of 1G and hugetlb migration series. 
Can you add 2M and 1G #defines also so that i can drop the patch from my 
series and pick this ?

-aneesh
Anshuman Khandual April 4, 2017, 1:50 p.m. UTC | #2
On 04/04/2017 02:03 PM, Aneesh Kumar K.V wrote:
> 
> 
> On Tuesday 04 April 2017 11:33 AM, Anshuman Khandual wrote:
>> This just adds user space exported ABI definitions for both 16MB and
>> 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)
>>
>>  arch/powerpc/include/uapi/asm/mman.h | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/powerpc/include/uapi/asm/mman.h
>> b/arch/powerpc/include/uapi/asm/mman.h
>> index 03c06ba..e78980b 100644
>> --- a/arch/powerpc/include/uapi/asm/mman.h
>> +++ b/arch/powerpc/include/uapi/asm/mman.h
>> @@ -29,4 +29,7 @@
>>  #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 */
>>
>> +#define MAP_HUGE_16MB    (24 << MAP_HUGE_SHIFT)    /* 16MB HugeTLB
>> Page */
>> +#define MAP_HUGE_16GB    (34 << MAP_HUGE_SHIFT)    /* 16GB HugeTLB
>> Page */
>> +
>>  #endif /* _UAPI_ASM_POWERPC_MMAN_H */
>>
> 
> I am doing a similar patch as part of 1G and hugetlb migration series.
> Can you add 2M and 1G #defines also so that i can drop the patch from my
> series and pick this ?

Sure, will just have to add the two lines from x86 code :)
diff mbox

Patch

diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
index 03c06ba..e78980b 100644
--- a/arch/powerpc/include/uapi/asm/mman.h
+++ b/arch/powerpc/include/uapi/asm/mman.h
@@ -29,4 +29,7 @@ 
 #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 */
 
+#define MAP_HUGE_16MB	(24 << MAP_HUGE_SHIFT)	/* 16MB HugeTLB Page */
+#define MAP_HUGE_16GB	(34 << MAP_HUGE_SHIFT)	/* 16GB HugeTLB Page */
+
 #endif /* _UAPI_ASM_POWERPC_MMAN_H */