diff options
author | Rich Felker <dalias@libc.org> | 2015-12-09 19:37:53 +0000 |
---|---|---|
committer | Rich Felker <dalias@libc.org> | 2016-04-28 20:47:50 +0000 |
commit | 511bc46f2afc11ccb966c65391fe6488e82d05b9 (patch) | |
tree | 49b53c729226f470c292651720d74dd47c33951b /.get_maintainer.ignore | |
parent | 09facf50a3243f5ea54c863a22f2b1f4ca6b0376 (diff) | |
download | linux-sh-511bc46f2afc11ccb966c65391fe6488e82d05b9.tar.gz |
ramfs: fix VM_MAYSHARE mappings for NOMMU
The nommu do_mmap expects f_op->get_unmapped_area to either succeed or
return -ENOSYS for VM_MAYSHARE (e.g. private read-only) mappings.
Returning addr in the non-MAP_SHARED case was completely wrong, and
only happened to work because addr was 0. However, it prevented
VM_MAYSHARE mappings from sharing backing with the fs cache, and
forced such mappings (including shareable program text) to be copied
whenever the number of mappings transitioned from 0 to 1, impacting
performance and memory usage. Subsequent mappings beyond the first
still correctly shared memory with the first.
Instead, treat VM_MAYSHARE identically to VM_SHARED at the file ops
level; do_mmap already handles the semantic differences between them.
Signed-off-by: Rich Felker <dalias@libc.org>
Diffstat (limited to '.get_maintainer.ignore')
0 files changed, 0 insertions, 0 deletions