the problem: doing malloc() in userspace on no-mmu systems can take up an inordinate amount of time merely due to kernel forcing anonymously mapped memory to zero. this is because the only way to implement userspace malloc() on no-mmu systems is via mmap(MAP_ANONYMOUS), and the kernel has an explicit memset() in mm/nommu.c:do_mmap_private() when MAP_ANONYMOUS is in the mmap flags. however, POSIX states that memory returned from malloc() may be uninitialized, so this zeroing is not wanted in that case. the desire: be able to do a mmap(MAP_ANONYMOUS) to grab a chunk of memory without the memset() call. this may bring up other arguments such as information leakage between kernels/processes, but on an embedded no-mmu system, people are very willing to sacrifice that for the very measurable performance gain. 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. another idea: move the memset() from the kernel to the system C library. make the kernel memset() controllable via a no-mmu/embedded-only Kconfig option (with the default being retained: the memset is called). now the C library can easily control the zero-ing of memory as required by POSIX, and you spend less time in kernel space. there are many places where the kernel<->user ABI is not POSIX compliant and instead relies on the C library to provide the little bit of POSIX glue, so this isnt a big deal. -mike --
| Ingo Molnar | [patch 12/13] syslets: x86: optimized copy_uatom() |
| Greg Kroah-Hartman | [PATCH 017/196] aoechr: Convert from class_device to device |
| Yinghai Lu | Re: 2.6.26, PAT and AMD family 6 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
