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 --
| Alan Cox | [PATCH 00/76] Queued TTY Patches |
| Linus Torvalds | Linux 2.6.27 |
| Eric W. Biederman | [PATCH] nfsd/nfs4state: Remove unnecessary daemonize call. |
| Artem Bityutskiy | [PATCH 10/44 take 2] [UBI] debug unit implementation |
git: | |
| Daniel Barkalow | Re: I don't want the .git directory next to my code. |
| Johannes Schindelin | Re: [PATCH] RFC: git lazy clone proof-of-concept |
| Johannes Schindelin | Re: [ANNOUNCE] GIT 1.5.4 |
| Johannes Schindelin | Re: git-diff on touched files: bug or feature? |
| Richard Stallman | Real men don't attack straw men |
| Juan Miscaro | When will OpenBSD support UTF8? |
| Stefan Beke | mail dovecot: pipe() failed: Too many open files |
| L. V. Lammert | Re: About Xen: maybe a reiterative question but .. |
| Michael Buesch | Re: Mark IPW2100 as BROKEN: Fatal interrupt. Scheduling firmware restart. |
| Johannes Berg | Re: mac80211 truesize bugs |
| Vitaliy Gusev | [TCP]: TCP_DEFER_ACCEPT causes leak sockets |
| Alexey Dobriyan | [PATCH 10/33] netns ct: per-netns /proc/net/nf_conntrack_expect |
| Shared swap partition | 30 minutes ago | Linux general |
| high memory | 1 day ago | Linux kernel |
| semaphore access speed | 1 day ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 2 days ago | Linux general |
