lkml.org 
[lkml]   [2008]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RFC, v2] shmat: introduce flag SHM_MAP_HINT
On Tue, 7 Oct 2008, Andi Kleen wrote:
> > I want say that we shouldn't do this check if shmaddr is a search hint.
> > I'm not sure that check is unneeded if shmadd is the exact address.
>
> mmap should fail in this case because it does the same check for
> MAP_FIXED. Obviously it cannot succeed when there is already something
> else there.

I'm not really following this, so forgive me if I'm reading you
out of context, but I think you're wrong on that...

The dangerous feature of mmap MAP_FIXED (why we don't usually use
it except within an address range we've already staked out earlier)
is that it does unmap whatever stands in its way. See the early
if (flags & MAP_FIXED)
return addr;
in arch_get_unmapped_area(), and the do_munmap() in mmap_region().

Hugh


\
 
 \ /
  Last update: 2008-10-07 16:43    [W:1.576 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site