login
Header Space

 
 

Re: [PATCH] Inconsistent mmap()/mremap() flags

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Thayne Harbaugh <thayne@...>
Cc: Andi Kleen <andi@...>, <linux-kernel@...>, <linux-mm@...>, <discuss@...>
Date: Tuesday, October 2, 2007 - 1:15 am

On Mon, Oct 01, 2007 at 08:57:10PM -0600, Thayne Harbaugh wrote:

Your perspective seems quite narrow. Only using 2GB instead of 4GB 
is a major functional difference.

Negative error values are used in all system calls, so it would
hardly seem necessary to encode the use of the 32th bit for that
in the option name.


For mmap you can emulate it by passing a low hint != 0 (e.g. getpagesize()) 
in address but without MAP_FIXED and checking if the result is not beyond
your range.


That would limit the 32bit architectures to 2GB; but their real limit
is 4GB. Losing half of the address space definitely would make users unhappy
(e.g. at least normal Linux kernels wouldn't run at all) 

The reason it's only 2GB is that the flag was added to support the small
code model of x86-64, which is limited to 2GB (31bit). Yes it's misnamed. 
But it's not used for the 32bit compat code.


It doesn't really for that case


I guess you mean inconsistent. 

Does qemu actually need mremap() ?  It would surprise me because
a lot of other OS don't implement it.

-Andi

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Inconsistent mmap()/mremap() flags, Thayne Harbaugh, (Fri Sep 28, 1:46 am)
Re: [PATCH] Inconsistent mmap()/mremap() flags, Andi Kleen, (Mon Oct 1, 7:13 am)
Re: [PATCH] Inconsistent mmap()/mremap() flags, Thayne Harbaugh, (Mon Oct 1, 10:57 pm)
Re: [PATCH] Inconsistent mmap()/mremap() flags, Andi Kleen, (Tue Oct 2, 1:15 am)
Re: [PATCH] Inconsistent mmap()/mremap() flags, Thayne Harbaugh, (Tue Oct 2, 3:06 am)
Re: [PATCH] Inconsistent mmap()/mremap() flags, Hugh Dickins, (Tue Oct 2, 8:19 am)
Re: [discuss] [PATCH] Inconsistent mmap()/mremap() flags, Thayne Harbaugh, (Tue Oct 2, 11:21 am)
speck-geostationary