Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684532

Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE

From Mike Kravetz <mike.kravetz@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE
Date 2017-07-10 19:40 +0200
Message-ID <u1KP8-7Xs-37@gated-at.bofh.it> (permalink)
References <u1FcL-4qZ-39@gated-at.bofh.it> <u1Hey-5Fo-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm/mremap: Document MREMAP_FIXED dependency on MREMAP_MAYMOVE Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-07-10 13:40 +0200
  Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on  MREMAP_MAYMOVE Michal Hocko <mhocko@kernel.org> - 2017-07-10 15:50 +0200
    Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on  MREMAP_MAYMOVE Mike Kravetz <mike.kravetz@oracle.com> - 2017-07-10 19:40 +0200
      Re: [PATCH] mm/mremap: Document MREMAP_FIXED dependency on  MREMAP_MAYMOVE Anshuman Khandual <khandual@linux.vnet.ibm.com> - 2017-07-11 04:20 +0200

csiph-web