Re: nommu: handling anonymous mmap clearing in userspace rather than kernel

From: David Howells
Date: Wed Apr 02 2008 - 10:45:01 EST


Mike Frysinger <vapier.adi@xxxxxxxxx> 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.

David


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/