Rich Felker
63678c32e2
tmpfs/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 >
Cc: Michal Hocko <mhocko@suse.com >
Cc: Greg Ungerer <gerg@uclinux.org >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-05-20 17:58:30 -07:00
..
2016-05-17 15:05:23 -07:00
2016-01-20 17:09:18 -08:00
2016-05-17 15:05:23 -07:00
2016-05-17 16:26:30 -07:00
2016-05-02 19:49:32 -04:00
2016-05-10 14:24:57 -04:00
2016-05-09 11:41:14 -04:00
2016-05-18 10:28:45 -07:00
2016-04-04 10:41:08 -07:00
2016-05-18 10:08:45 -07:00
2016-05-19 09:21:36 -07:00
2016-05-02 19:49:29 -04:00
2016-05-09 11:41:13 -04:00
2016-05-09 11:41:14 -04:00
2016-04-12 20:01:35 -07:00
2016-04-12 15:01:53 -07:00
2016-04-26 15:47:32 -07:00
2016-04-04 10:41:08 -07:00
2016-05-18 11:51:59 -07:00
2016-05-07 07:06:13 +02:00
2016-05-09 11:41:14 -04:00
2016-05-17 17:05:30 -07:00
2016-05-02 19:49:29 -04:00
2016-05-17 15:05:23 -07:00
2016-05-17 15:05:23 -07:00
2016-05-17 15:05:23 -07:00
2016-05-17 15:05:23 -07:00
2016-05-09 11:41:14 -04:00
2016-04-04 10:41:08 -07:00
2016-05-17 15:05:23 -07:00
2016-05-18 10:08:45 -07:00
2016-05-17 15:05:23 -07:00
2016-05-17 15:05:23 -07:00
2016-05-12 19:49:30 -04:00
2016-05-12 19:47:13 -04:00
2016-04-04 10:41:08 -07:00
2016-05-11 00:00:29 -04:00
2016-04-18 11:18:55 +02:00
2016-05-09 11:41:14 -04:00
2016-05-18 10:08:45 -07:00
2016-05-17 11:01:31 -07:00
2016-01-07 10:10:50 -05:00
2016-05-09 11:42:19 -04:00
2016-05-02 19:49:32 -04:00
2016-04-04 10:41:08 -07:00
2016-05-19 09:21:36 -07:00
2016-05-17 15:05:23 -07:00
2016-05-17 15:05:23 -07:00
2016-05-19 19:12:14 -07:00
2016-05-01 19:58:39 -04:00
2016-05-19 19:12:14 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-05-02 19:47:23 -04:00
2016-05-17 02:17:59 -04:00
2016-05-19 20:00:06 -07:00
2016-04-04 10:41:08 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-04-26 12:00:48 -04:00
2016-05-20 17:58:30 -07:00
2016-05-17 15:05:23 -07:00
2016-05-09 11:41:15 -04:00
2016-05-09 11:41:15 -04:00
2016-05-02 19:49:32 -04:00
2016-01-22 18:04:28 -05:00
2016-05-18 10:08:45 -07:00
2016-05-17 15:05:23 -07:00
2016-05-02 19:49:32 -04:00
2016-05-18 10:28:45 -07:00
2016-04-03 19:51:33 -04:00
2016-01-22 18:04:28 -05:00
2016-04-11 00:48:00 -04:00
2016-05-18 11:51:59 -07:00
2016-05-18 11:51:59 -07:00
2016-01-22 18:04:28 -05:00
2016-05-01 19:58:39 -04:00
2016-05-19 19:12:14 -07:00
2016-02-14 14:25:59 -08:00
2016-05-02 19:49:28 -04:00
2016-05-12 16:55:50 -04:00
2016-05-01 19:58:39 -04:00
2016-05-18 11:51:59 -07:00
2016-05-01 19:58:39 -04:00
2016-03-22 15:36:02 -07:00
2016-05-19 19:12:14 -07:00
2016-05-19 09:21:36 -07:00
2016-01-09 02:55:37 -05:00
2016-03-22 15:36:02 -07:00
2016-05-02 19:49:28 -04:00
2016-01-19 12:02:23 -05:00
2016-04-04 10:41:08 -07:00
2016-05-02 19:49:28 -04:00
2016-01-08 21:20:11 -05:00
2016-01-22 18:04:28 -05:00
2016-03-26 12:59:04 -07:00
2016-05-09 11:41:14 -04:00
2016-01-22 18:04:28 -05:00
2016-03-26 12:59:04 -07:00
2016-02-22 22:44:04 -05:00
2016-04-04 10:41:08 -07:00
2016-05-19 09:21:36 -07:00
2016-01-22 18:04:28 -05:00
2016-05-17 14:41:03 -07:00
2016-04-04 10:41:08 -07:00
2016-05-05 09:54:45 -05:00
2016-04-10 20:48:24 -04:00
2016-03-16 13:09:08 -04:00
2016-05-18 11:46:23 -07:00
2016-05-02 19:49:29 -04:00
2016-05-19 19:12:14 -07:00
2016-04-14 12:56:09 -07:00
2016-05-11 00:00:29 -04:00
2016-01-16 11:17:23 -08:00
2016-04-18 11:18:55 +02:00
2016-04-04 10:41:08 -07:00
2016-01-17 11:13:55 +01:00
2016-03-02 09:03:18 -08:00
2016-01-22 18:04:28 -05:00
2016-04-11 00:48:00 -04:00