[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: nommu: handling anonymous mmap clearing in userspace rather than kernel
On Wed, Apr 2, 2008 at 10:20 AM, David Howells <> wrote:
> Mike Frysinger <> wrote:
> > a workaround: introduce a new no-mmu-only mmap flag MAP_UNINITIALIZE
> > to signal to the kernel that it should skip the memset(). this way,
> > userspace malloc() can do mmap(MAP_ANONYMOUS|MAP_UNINITIALIZE) to get
> > large chunks of memory without affecting any other anonymous mmap()
> > call.
> I think that's reasonable for NOMMU. It's not like the process accessing the
> uninitialised memory is prevented from accessing anything it wants to anyway.
> I would vote that the memset() should only be skipped if requested as there
> may be programs that call mmap(MAP_ANONYMOUS) expecting the memory they're
> given to be zeroed out.

in the second proposal, the C library would be expected to do this, so
no programs would be broken. but you're right that any program that
invokes the mmap() syscall directly would not get zeroed memory ...
but is anyone doing such a crazy thing, let alone on embedded ?

 \ /
  Last update: 2008-04-02 16:51    [W:0.084 / U:2.300 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site