Skip to content

KSM fixes

Andrea Arcangeli linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ksm: fix rmap_item->anon_vma memory corruption and vma user after freemm/ksm.c+51 -42 replies
2/6ksm: add cond_resched() to the rmap_walksmm/ksm.c mm/rmap.c+6 -03 replies
3/6ksm: don't fail stable tree lookups if walking over stale stable_nodesmm/ksm.c+27 -32 replies
4/6ksm: use the helper method to do the hlist_empty checkmm/ksm.c+1 -11 reply
5/6ksm: use find_mergeable_vma in try_to_merge_with_ksm_pagemm/ksm.c+2 -41 reply
6/6ksm: unstable_tree_search_insert error checking cleanupmm/ksm.c+1 -13 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchHugh Dickins
1/6
2/6A-b
3/6A-b
4/6A-b
5/6A-b
6/6A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] KSM fixes

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>