* [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
@ 2017-07-10 11:32 ` Anshuman Khandual
0 siblings, 0 replies; 8+ messages in thread
From: Anshuman Khandual @ 2017-07-10 11:32 UTC (permalink / raw)
To: linux-mm, linux-kernel; +Cc: akpm, mike.kravetz
In the header file, just specify the dependency of MREMAP_FIXED
on MREMAP_MAYMOVE and make it explicit for the user space.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
include/uapi/linux/mman.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
index ade4acd..8cae3f6 100644
--- a/include/uapi/linux/mman.h
+++ b/include/uapi/linux/mman.h
@@ -3,8 +3,10 @@
#include <asm/mman.h>
-#define MREMAP_MAYMOVE 1
-#define MREMAP_FIXED 2
+#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
+#define MREMAP_FIXED 2 /* VMA can remap at particular address */
+
+/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
#define OVERCOMMIT_GUESS 0
#define OVERCOMMIT_ALWAYS 1
--
1.8.5.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
@ 2017-07-10 11:32 ` Anshuman Khandual
0 siblings, 0 replies; 8+ messages in thread
From: Anshuman Khandual @ 2017-07-10 11:32 UTC (permalink / raw)
To: linux-mm, linux-kernel; +Cc: akpm, mike.kravetz
In the header file, just specify the dependency of MREMAP_FIXED
on MREMAP_MAYMOVE and make it explicit for the user space.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
include/uapi/linux/mman.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
index ade4acd..8cae3f6 100644
--- a/include/uapi/linux/mman.h
+++ b/include/uapi/linux/mman.h
@@ -3,8 +3,10 @@
#include <asm/mman.h>
-#define MREMAP_MAYMOVE 1
-#define MREMAP_FIXED 2
+#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
+#define MREMAP_FIXED 2 /* VMA can remap at particular address */
+
+/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
#define OVERCOMMIT_GUESS 0
#define OVERCOMMIT_ALWAYS 1
--
1.8.5.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
2017-07-10 11:32 ` Anshuman Khandual
@ 2017-07-10 13:41 ` Michal Hocko
-1 siblings, 0 replies; 8+ messages in thread
From: Michal Hocko @ 2017-07-10 13:41 UTC (permalink / raw)
To: Anshuman Khandual; +Cc: linux-mm, linux-kernel, akpm, mike.kravetz
On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
> In the header file, just specify the dependency of MREMAP_FIXED
> on MREMAP_MAYMOVE and make it explicit for the user space.
I really fail to see a point of this patch. The depency belongs to the
code and it seems that we already enforce it
if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
return ret;
So what is the point here?
> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
> ---
> include/uapi/linux/mman.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
> index ade4acd..8cae3f6 100644
> --- a/include/uapi/linux/mman.h
> +++ b/include/uapi/linux/mman.h
> @@ -3,8 +3,10 @@
>
> #include <asm/mman.h>
>
> -#define MREMAP_MAYMOVE 1
> -#define MREMAP_FIXED 2
> +#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
> +#define MREMAP_FIXED 2 /* VMA can remap at particular address */
> +
> +/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
>
> #define OVERCOMMIT_GUESS 0
> #define OVERCOMMIT_ALWAYS 1
> --
> 1.8.5.2
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
@ 2017-07-10 13:41 ` Michal Hocko
0 siblings, 0 replies; 8+ messages in thread
From: Michal Hocko @ 2017-07-10 13:41 UTC (permalink / raw)
To: Anshuman Khandual; +Cc: linux-mm, linux-kernel, akpm, mike.kravetz
On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
> In the header file, just specify the dependency of MREMAP_FIXED
> on MREMAP_MAYMOVE and make it explicit for the user space.
I really fail to see a point of this patch. The depency belongs to the
code and it seems that we already enforce it
if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
return ret;
So what is the point here?
> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
> ---
> include/uapi/linux/mman.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
> index ade4acd..8cae3f6 100644
> --- a/include/uapi/linux/mman.h
> +++ b/include/uapi/linux/mman.h
> @@ -3,8 +3,10 @@
>
> #include <asm/mman.h>
>
> -#define MREMAP_MAYMOVE 1
> -#define MREMAP_FIXED 2
> +#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
> +#define MREMAP_FIXED 2 /* VMA can remap at particular address */
> +
> +/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
>
> #define OVERCOMMIT_GUESS 0
> #define OVERCOMMIT_ALWAYS 1
> --
> 1.8.5.2
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
2017-07-10 13:41 ` Michal Hocko
@ 2017-07-10 17:31 ` Mike Kravetz
-1 siblings, 0 replies; 8+ messages in thread
From: Mike Kravetz @ 2017-07-10 17:31 UTC (permalink / raw)
To: Michal Hocko, Anshuman Khandual; +Cc: linux-mm, linux-kernel, akpm
On 07/10/2017 06:41 AM, Michal Hocko wrote:
> On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
>> In the header file, just specify the dependency of MREMAP_FIXED
>> on MREMAP_MAYMOVE and make it explicit for the user space.
>
> I really fail to see a point of this patch. The depency belongs to the
> code and it seems that we already enforce it
> if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
> return ret;
>
> So what is the point here?
Agree, I am not sure of your reasoning.
If to assist the programmer, there is no need as this is clearly specified
in the man page:
"If MREMAP_FIXED is specified, then MREMAP_MAYMOVE must also be
specified."
--
Mike Kravetz
>
>> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
>> ---
>> include/uapi/linux/mman.h | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
>> index ade4acd..8cae3f6 100644
>> --- a/include/uapi/linux/mman.h
>> +++ b/include/uapi/linux/mman.h
>> @@ -3,8 +3,10 @@
>>
>> #include <asm/mman.h>
>>
>> -#define MREMAP_MAYMOVE 1
>> -#define MREMAP_FIXED 2
>> +#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
>> +#define MREMAP_FIXED 2 /* VMA can remap at particular address */
>> +
>> +/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
>>
>> #define OVERCOMMIT_GUESS 0
>> #define OVERCOMMIT_ALWAYS 1
>> --
>> 1.8.5.2
>>
>> --
>> To unsubscribe, send a message with 'unsubscribe linux-mm' in
>> the body to majordomo@kvack.org. For more info on Linux MM,
>> see: http://www.linux-mm.org/ .
>> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
@ 2017-07-10 17:31 ` Mike Kravetz
0 siblings, 0 replies; 8+ messages in thread
From: Mike Kravetz @ 2017-07-10 17:31 UTC (permalink / raw)
To: Michal Hocko, Anshuman Khandual; +Cc: linux-mm, linux-kernel, akpm
On 07/10/2017 06:41 AM, Michal Hocko wrote:
> On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
>> In the header file, just specify the dependency of MREMAP_FIXED
>> on MREMAP_MAYMOVE and make it explicit for the user space.
>
> I really fail to see a point of this patch. The depency belongs to the
> code and it seems that we already enforce it
> if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
> return ret;
>
> So what is the point here?
Agree, I am not sure of your reasoning.
If to assist the programmer, there is no need as this is clearly specified
in the man page:
"If MREMAP_FIXED is specified, then MREMAP_MAYMOVE must also be
specified."
--
Mike Kravetz
>
>> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
>> ---
>> include/uapi/linux/mman.h | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
>> index ade4acd..8cae3f6 100644
>> --- a/include/uapi/linux/mman.h
>> +++ b/include/uapi/linux/mman.h
>> @@ -3,8 +3,10 @@
>>
>> #include <asm/mman.h>
>>
>> -#define MREMAP_MAYMOVE 1
>> -#define MREMAP_FIXED 2
>> +#define MREMAP_MAYMOVE 1 /* VMA can move after remap and resize */
>> +#define MREMAP_FIXED 2 /* VMA can remap at particular address */
>> +
>> +/* NOTE: MREMAP_FIXED must be set with MREMAP_MAYMOVE, not alone */
>>
>> #define OVERCOMMIT_GUESS 0
>> #define OVERCOMMIT_ALWAYS 1
>> --
>> 1.8.5.2
>>
>> --
>> To unsubscribe, send a message with 'unsubscribe linux-mm' in
>> the body to majordomo@kvack.org. For more info on Linux MM,
>> see: http://www.linux-mm.org/ .
>> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
2017-07-10 17:31 ` Mike Kravetz
@ 2017-07-11 2:15 ` Anshuman Khandual
-1 siblings, 0 replies; 8+ messages in thread
From: Anshuman Khandual @ 2017-07-11 2:15 UTC (permalink / raw)
To: Mike Kravetz, Michal Hocko, Anshuman Khandual
Cc: linux-mm, linux-kernel, akpm
On 07/10/2017 11:01 PM, Mike Kravetz wrote:
> On 07/10/2017 06:41 AM, Michal Hocko wrote:
>> On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
>>> In the header file, just specify the dependency of MREMAP_FIXED
>>> on MREMAP_MAYMOVE and make it explicit for the user space.
>> I really fail to see a point of this patch. The depency belongs to the
>> code and it seems that we already enforce it
>> if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
>> return ret;
>>
>> So what is the point here?
> Agree, I am not sure of your reasoning.
>
> If to assist the programmer, there is no need as this is clearly specified
> in the man page:
>
> "If MREMAP_FIXED is specified, then MREMAP_MAYMOVE must also be
> specified."
Yeah the idea was to assist the programmer and I missed the man page's
details on this. My bad.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
@ 2017-07-11 2:15 ` Anshuman Khandual
0 siblings, 0 replies; 8+ messages in thread
From: Anshuman Khandual @ 2017-07-11 2:15 UTC (permalink / raw)
To: Mike Kravetz, Michal Hocko, Anshuman Khandual
Cc: linux-mm, linux-kernel, akpm
On 07/10/2017 11:01 PM, Mike Kravetz wrote:
> On 07/10/2017 06:41 AM, Michal Hocko wrote:
>> On Mon 10-07-17 17:02:11, Anshuman Khandual wrote:
>>> In the header file, just specify the dependency of MREMAP_FIXED
>>> on MREMAP_MAYMOVE and make it explicit for the user space.
>> I really fail to see a point of this patch. The depency belongs to the
>> code and it seems that we already enforce it
>> if (flags & MREMAP_FIXED && !(flags & MREMAP_MAYMOVE))
>> return ret;
>>
>> So what is the point here?
> Agree, I am not sure of your reasoning.
>
> If to assist the programmer, there is no need as this is clearly specified
> in the man page:
>
> "If MREMAP_FIXED is specified, then MREMAP_MAYMOVE must also be
> specified."
Yeah the idea was to assist the programmer and I missed the man page's
details on this. My bad.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-07-11 2:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10 11:32 [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE Anshuman Khandual
2017-07-10 11:32 ` Anshuman Khandual
2017-07-10 13:41 ` Michal Hocko
2017-07-10 13:41 ` Michal Hocko
2017-07-10 17:31 ` Mike Kravetz
2017-07-10 17:31 ` Mike Kravetz
2017-07-11 2:15 ` Anshuman Khandual
2017-07-11 2:15 ` Anshuman Khandual
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.