linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] KSM fixes
@ 2015-10-15 16:04 Andrea Arcangeli
  2015-10-15 16:04 ` [PATCH 1/6] ksm: fix rmap_item->anon_vma memory corruption and vma user after free Andrea Arcangeli
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Andrea Arcangeli @ 2015-10-15 16:04 UTC (permalink / raw)
  To: Hugh Dickins, Petr Holasek; +Cc: linux-mm, Andrew Morton

Hello,

With a stress test leveraging Hugh's allksm old patch, I found a
random memory corruption bug (modify and user after free). It's firing
oopses and generic instability so it's not just theoretical, but it
can only be reproduced in practice with frequent exits and KSM at 100%
CPU load. Note that it's common to give an entire core to KSM when the
system is low on memory in production, http://www.ovirt.org/MoM is
likely to do that as well. The allksm hack (not in this patchset) only
facilitates at creating a workload that exit frequently to increase
the frequency of the race window, without having to patch and rebuild
binaries to call the MADV_MERGEABLE by hand.

I also did some other orthogonal optimization and cleanup.

I'm sending those upstream standalone, separately from some more
complex larger and orthogonal pending changes I'm currently working
on. Those will take more time to review and this fix is higher
priority.

I haven't added -stable but at least 1/6 is definitely a candidate for
stable, IMHO 2/6 would be good idea too. If this passes review and the
fix is confirmed, I can resubmit at least 1/6 to stable. Comments?

Thanks,
Andrea

Andrea Arcangeli (6):
  ksm: fix rmap_item->anon_vma memory corruption and vma user after free
  ksm: add cond_resched() to the rmap_walks
  ksm: don't fail stable tree lookups if walking over stale stable_nodes
  ksm: use the helper method to do the hlist_empty check
  ksm: use find_mergeable_vma in try_to_merge_with_ksm_page
  ksm: unstable_tree_search_insert error checking cleanup

 mm/ksm.c  | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
 mm/rmap.c |  4 +++
 2 files changed, 88 insertions(+), 13 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-11-02  0:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 16:04 [PATCH 0/6] KSM fixes Andrea Arcangeli
2015-10-15 16:04 ` [PATCH 1/6] ksm: fix rmap_item->anon_vma memory corruption and vma user after free Andrea Arcangeli
2015-10-26  0:12   ` Hugh Dickins
2015-10-30 18:55     ` Andrea Arcangeli
2015-10-15 16:04 ` [PATCH 2/6] ksm: add cond_resched() to the rmap_walks Andrea Arcangeli
2015-10-25 23:41   ` Hugh Dickins
2015-10-27  0:32     ` Davidlohr Bueso
2015-11-01 22:19       ` Andrea Arcangeli
2015-10-15 16:04 ` [PATCH 3/6] ksm: don't fail stable tree lookups if walking over stale stable_nodes Andrea Arcangeli
2015-10-25 23:34   ` Hugh Dickins
2015-11-01 23:03     ` Andrea Arcangeli
2015-10-15 16:04 ` [PATCH 4/6] ksm: use the helper method to do the hlist_empty check Andrea Arcangeli
2015-10-25 23:22   ` Hugh Dickins
2015-10-15 16:04 ` [PATCH 5/6] ksm: use find_mergeable_vma in try_to_merge_with_ksm_page Andrea Arcangeli
2015-10-25 23:21   ` Hugh Dickins
2015-10-15 16:04 ` [PATCH 6/6] ksm: unstable_tree_search_insert error checking cleanup Andrea Arcangeli
2015-10-25 23:18   ` Hugh Dickins
2015-11-01 23:45     ` Andrea Arcangeli
2015-11-02  0:23       ` Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).