Vitaly Vul ee67dd75e2 mmap: fix calculation of is_private_anonymous variable
Currently is_private_anonymous is calculated as true if _either_
MAP_PRIVATE or MAP_ANONYMOUS is set, which is a mistake.
According to Documentation/vm/ksm.txt, "KSM only merges anonymous
(private) pages, never pagecache (file) pages". MAP_PRIVATE can
still be set on file cache pages so in order to not redundantly
set MADV_MERGEABLE on pages that are not fitted for it, both
MAP_PRIVATE and MAP_ANONYMOUS should be set.

Along with this fix, add an extra check that the mapped page is
not a stack page before setting MADV_MERGEABLE for it. Stack pages
change too quickly and always end up in KSM 'page_volatile' list.

Change-Id: If4954142852f17cc61f02985ea1cb625a7f3dec6
2015-11-20 09:16:59 -08:00
..
2015-11-06 13:14:43 -08:00
2015-11-06 13:14:43 -08:00
2015-11-06 13:14:43 -08:00
2015-11-06 13:14:43 -08:00
2015-11-06 13:14:43 -08:00
2015-11-06 13:14:43 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-07-27 11:04:58 -07:00
2015-10-09 17:58:58 +01:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-11-18 17:51:21 -08:00
2015-08-28 20:23:52 -07:00
2015-11-06 13:14:43 -08:00
2015-05-07 15:12:24 -07:00