All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/hugetlb: Add ABI defines for MAP_HUGE_16MB and MAP_HUGE_16GB
@ 2017-04-04  6:03 Anshuman Khandual
  2017-04-04  8:33 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-04  6:03 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: aneesh.kumar, mpe

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 */
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH] powerpc/hugetlb: Add ABI defines for MAP_HUGE_16MB and MAP_HUGE_16GB
  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
  0 siblings, 1 reply; 15+ messages in thread
From: Aneesh Kumar K.V @ 2017-04-04  8:33 UTC (permalink / raw)
  To: Anshuman Khandual, linuxppc-dev



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] powerpc/hugetlb: Add ABI defines for MAP_HUGE_16MB and MAP_HUGE_16GB
  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
  0 siblings, 1 reply; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-04 13:50 UTC (permalink / raw)
  To: Aneesh Kumar K.V, linuxppc-dev

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 :)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH V2] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-04 13:50   ` Anshuman Khandual
@ 2017-04-05  5:19     ` Anshuman Khandual
  2017-04-05  6:59       ` Balbir Singh
  0 siblings, 1 reply; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-05  5:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: aneesh.kumar, mpe

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 V2:
- Added definitions for 2MB and 1GB HugeTLB pages per Aneesh

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

diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
index 03c06ba..3eb788c 100644
--- a/arch/powerpc/include/uapi/asm/mman.h
+++ b/arch/powerpc/include/uapi/asm/mman.h
@@ -29,4 +29,9 @@
 #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_2MB	(21 << MAP_HUGE_SHIFT)	/* 2MB 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH V2] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  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
  0 siblings, 1 reply; 15+ messages in thread
From: Balbir Singh @ 2017-04-05  6:59 UTC (permalink / raw)
  To: Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

On Wed, 2017-04-05 at 10:49 +0530, Anshuman Khandual wrote:
> 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 V2:
> - Added definitions for 2MB and 1GB HugeTLB pages per Aneesh

I think it also helps if you mention these are used in bits 26:31 (6 bits)
to encode the size.

> 
>  arch/powerpc/include/uapi/asm/mman.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
> index 03c06ba..3eb788c 100644
> --- a/arch/powerpc/include/uapi/asm/mman.h
> +++ b/arch/powerpc/include/uapi/asm/mman.h
> @@ -29,4 +29,9 @@
>  #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_2MB	(21 << MAP_HUGE_SHIFT)	/* 2MB 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 */

We may want to call out what MMU supports what size, so that an error can
be interpreted from the header file comments.

Reviewed-by: Balbir Singh <bsingharora@gmail.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH V2] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-05  6:59       ` Balbir Singh
@ 2017-04-05  7:09         ` Michael Ellerman
  2017-04-05 11:20           ` [PATCH V3] " Anshuman Khandual
  0 siblings, 1 reply; 15+ messages in thread
From: Michael Ellerman @ 2017-04-05  7:09 UTC (permalink / raw)
  To: Balbir Singh, Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

Balbir Singh <bsingharora@gmail.com> writes:
> On Wed, 2017-04-05 at 10:49 +0530, Anshuman Khandual wrote:
>> diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
>> index 03c06ba..3eb788c 100644
>> --- a/arch/powerpc/include/uapi/asm/mman.h
>> +++ b/arch/powerpc/include/uapi/asm/mman.h
>> @@ -29,4 +29,9 @@
>>  #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_2MB	(21 << MAP_HUGE_SHIFT)	/* 2MB 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 */
>
> We may want to call out what MMU supports what size, so that an error can
> be interpreted from the header file comments.

No don't, it can depend on what's configured in Linux and/or hypervisor
config and/or firmware and so on, so any header file comments are most
likely just going to be misleading and/or out of date.

cheers

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH V3] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-05  7:09         ` Michael Ellerman
@ 2017-04-05 11:20           ` Anshuman Khandual
  2017-04-06 19:03             ` LEROY Christophe
  0 siblings, 1 reply; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-05 11:20 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: aneesh.kumar, mpe

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 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/powerpc/include/uapi/asm/mman.h b/arch/powerpc/include/uapi/asm/mman.h
index 03c06ba..0c84e14 100644
--- a/arch/powerpc/include/uapi/asm/mman.h
+++ b/arch/powerpc/include/uapi/asm/mman.h
@@ -29,4 +29,14 @@
 #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 defines should be used for creating 'flags' argument
+ * (26:31 bits) for the mmap() system call should the caller
+ * decide to use non default HugeTLB page size.
+ */
+#define MAP_HUGE_2MB	(21 << MAP_HUGE_SHIFT)	/* 2MB 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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH V3] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-05 11:20           ` [PATCH V3] " Anshuman Khandual
@ 2017-04-06 19:03             ` LEROY Christophe
  2017-04-07  3:47               ` Anshuman Khandual
  0 siblings, 1 reply; 15+ messages in thread
From: LEROY Christophe @ 2017-04-06 19:03 UTC (permalink / raw)
  To: Anshuman Khandual; +Cc: aneesh.kumar, linuxppc-dev

Hi

Anshuman Khandual <khandual@linux.vnet.ibm.com> a =C3=A9crit=C2=A0:

> 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.

Why not add all possible huge page sizes ?
For instance the 8xx (only) supports 512k and 8M hugepages

Christophe

>
> 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 <<=20=20
>=20MAP_HUGE_SHIFT)
> arch/x86/include/uapi/asm/mman.h:#define MAP_HUGE_1GB    (30 <<=20=20
>=20MAP_HUGE_SHIFT)
>
> 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 | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/powerpc/include/uapi/asm/mman.h=20=20
>=20b/arch/powerpc/include/uapi/asm/mman.h
> index 03c06ba..0c84e14 100644
> --- a/arch/powerpc/include/uapi/asm/mman.h
> +++ b/arch/powerpc/include/uapi/asm/mman.h
> @@ -29,4 +29,14 @@
>  #define MAP_STACK	0x20000		/* give out an address that is best=20=20
>=20suited for process/thread stacks */
>  #define MAP_HUGETLB	0x40000		/* create a huge page mapping */
>
> +/*
> + * These defines should be used for creating 'flags' argument
> + * (26:31 bits) for the mmap() system call should the caller
> + * decide to use non default HugeTLB page size.
> + */
> +#define MAP_HUGE_2MB	(21 << MAP_HUGE_SHIFT)	/* 2MB 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH V3] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-06 19:03             ` LEROY Christophe
@ 2017-04-07  3:47               ` Anshuman Khandual
  2017-04-07  3:55                 ` [PATCH V4] " Anshuman Khandual
  0 siblings, 1 reply; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-07  3:47 UTC (permalink / raw)
  To: LEROY Christophe; +Cc: aneesh.kumar, linuxppc-dev

On 04/07/2017 12:33 AM, LEROY Christophe wrote:
> Hi
> 
> Anshuman Khandual <khandual@linux.vnet.ibm.com> a écrit :
> 
>> 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.
> 
> Why not add all possible huge page sizes ?
> For instance the 8xx (only) supports 512k and 8M hugepages

Sure, can do that.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07  3:47               ` Anshuman Khandual
@ 2017-04-07  3:55                 ` Anshuman Khandual
  2017-04-07 13:01                   ` Michael Ellerman
  2017-04-10 22:49                   ` [V4] " Michael Ellerman
  0 siblings, 2 replies; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-07  3:55 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: aneesh.kumar, mpe, christophe.leroy

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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07  3:55                 ` [PATCH V4] " Anshuman Khandual
@ 2017-04-07 13:01                   ` Michael Ellerman
  2017-04-07 14:58                     ` Anshuman Khandual
  2017-04-07 15:44                     ` Paul Clarke
  2017-04-10 22:49                   ` [V4] " Michael Ellerman
  1 sibling, 2 replies; 15+ messages in thread
From: Michael Ellerman @ 2017-04-07 13:01 UTC (permalink / raw)
  To: Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar, christophe.leroy

Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:

> 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.

I updated this for you to include all the sizes.

> 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.
> + */

And I reworded the comment the make it clearer (I think) that most users
shouldn't need to use these, and should just use the default size:

/*
 * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
 * A value of zero indicates that the default huge page size should be used.
 * To use a non-default huge page size, one of these defines can be used, or the
 * size can be encoded by hand. Note that on most systems only a subset, or
 * possibly none, of these sizes will be available.
 */


Also do you want to send a patch to the man page?

https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/mmap.2#n248

cheers

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07 13:01                   ` Michael Ellerman
@ 2017-04-07 14:58                     ` Anshuman Khandual
  2017-04-07 15:44                     ` Paul Clarke
  1 sibling, 0 replies; 15+ messages in thread
From: Anshuman Khandual @ 2017-04-07 14:58 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: aneesh.kumar

On 04/07/2017 06:31 PM, Michael Ellerman wrote:
> Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:
> 
>> 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.
> 
> I updated this for you to include all the sizes.
> 
>> 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.
>> + */
> 
> And I reworded the comment the make it clearer (I think) that most users
> shouldn't need to use these, and should just use the default size:
> 
> /*
>  * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
>  * A value of zero indicates that the default huge page size should be used.
>  * To use a non-default huge page size, one of these defines can be used, or the
>  * size can be encoded by hand. Note that on most systems only a subset, or
>  * possibly none, of these sizes will be available.
>  */

Yeah its clearer, thanks.

> 
> 
> Also do you want to send a patch to the man page?
> 
> https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man2/mmap.2#n248
> 

Sure, will do it.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07 13:01                   ` Michael Ellerman
  2017-04-07 14:58                     ` Anshuman Khandual
@ 2017-04-07 15:44                     ` Paul Clarke
  2017-04-08  9:19                       ` Michael Ellerman
  1 sibling, 1 reply; 15+ messages in thread
From: Paul Clarke @ 2017-04-07 15:44 UTC (permalink / raw)
  To: Michael Ellerman, Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

nits... take 'em or leave 'em...

On 04/07/2017 08:01 AM, Michael Ellerman wrote:
> Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:
> And I reworded the comment the make it clearer (I think) that most users
> shouldn't need to use these, and should just use the default size:
>
> /*
>  * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.

need a comma after "set".

also, "bits [26:31]" of what?

>  * A value of zero indicates that the default huge page size should be used.
>  * To use a non-default huge page size, one of these defines can be used, or the
>  * size can be encoded by hand. Note that on most systems only a subset, or
>  * possibly none, of these sizes will be available.
>  */

PC

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07 15:44                     ` Paul Clarke
@ 2017-04-08  9:19                       ` Michael Ellerman
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Ellerman @ 2017-04-08  9:19 UTC (permalink / raw)
  To: pc, Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

Paul Clarke <pc@us.ibm.com> writes:

> nits... take 'em or leave 'em...
>
> On 04/07/2017 08:01 AM, Michael Ellerman wrote:
>> Anshuman Khandual <khandual@linux.vnet.ibm.com> writes:
>> And I reworded the comment the make it clearer (I think) that most users
>> shouldn't need to use these, and should just use the default size:
>>
>> /*
>>  * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
>
> need a comma after "set".

Hmm, 'spose.

> also, "bits [26:31]" of what?

Flags!

But yeah fair cop, as it happened I was rebasing it anyway, so:

/*
 * When MAP_HUGETLB is set, bits [26:31] of the flags argument to mmap(2),
 * encode the log2 of the huge page size. A value of zero indicates that the
 * default huge page size should be used. To use a non-default huge page size,
 * one of these defines can be used, or the size can be encoded by hand. Note
 * that on most systems only a subset, or possibly none, of these sizes will be
 * available.
 */

Thanks for the review.

cheers

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [V4] powerpc/hugetlb: Add ABI defines for supported HugeTLB page sizes
  2017-04-07  3:55                 ` [PATCH V4] " Anshuman Khandual
  2017-04-07 13:01                   ` Michael Ellerman
@ 2017-04-10 22:49                   ` Michael Ellerman
  1 sibling, 0 replies; 15+ messages in thread
From: Michael Ellerman @ 2017-04-10 22:49 UTC (permalink / raw)
  To: Anshuman Khandual, linuxppc-dev; +Cc: aneesh.kumar

On Fri, 2017-04-07 at 03:55:39 UTC, Anshuman Khandual wrote:
> 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>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2c9faa7675fec57f6ac0372688fae2

cheers

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-04-10 22:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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                 ` [PATCH V4] " Anshuman Khandual
2017-04-07 13:01                   ` 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

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.