linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH uprobe, thp v2 0/5] THP aware uprobe
@ 2019-06-04 16:51 Song Liu
  2019-06-04 16:51 ` [PATCH uprobe, thp v2 1/5] mm: move memcmp_pages() and pages_identical() Song Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Song Liu @ 2019-06-04 16:51 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: peterz, oleg, rostedt, mhiramat, kirill.shutemov, kernel-team,
	william.kucharski, Song Liu

This set makes uprobe aware of THPs.

Currently, when uprobe is attached to text on THP, the page is split by
FOLL_SPLIT. As a result, uprobe eliminates the performance benefit of THP.

This set makes uprobe THP-aware. Instead of FOLL_SPLIT, we introduces
FOLL_SPLIT_PMD, which only split PMD for uprobe. After all uprobes within
the THP are removed, the PTEs are regrouped into huge PMD.

Note that, with uprobes attached, the process runs with PTEs for the huge
page. The performance benefit of THP is recovered _after_ all uprobes on
the huge page are detached.

This set (plus a few small debug patches) is also available at

   https://github.com/liu-song-6/linux/tree/uprobe-thp

Changes since v1:
1. introduces FOLL_SPLIT_PMD, instead of modifying split_huge_pmd*();
2. reuse pages_identical() from ksm.c;
3. rewrite most of try_collapse_huge_pmd().

Song Liu (5):
  mm: move memcmp_pages() and pages_identical()
  uprobe: use original page when all uprobes are removed
  mm, thp: introduce FOLL_SPLIT_PMD
  uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT
  uprobe: collapse THP pmd after removing all uprobes

 include/linux/huge_mm.h |  7 +++++
 include/linux/mm.h      |  8 +++++
 kernel/events/uprobes.c | 53 +++++++++++++++++++++++--------
 mm/gup.c                | 15 +++++++--
 mm/huge_memory.c        | 70 +++++++++++++++++++++++++++++++++++++++++
 mm/ksm.c                | 18 -----------
 mm/util.c               | 13 ++++++++
 7 files changed, 150 insertions(+), 34 deletions(-)

--
2.17.1

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

end of thread, other threads:[~2019-06-05 16:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 16:51 [PATCH uprobe, thp v2 0/5] THP aware uprobe Song Liu
2019-06-04 16:51 ` [PATCH uprobe, thp v2 1/5] mm: move memcmp_pages() and pages_identical() Song Liu
2019-06-04 16:51 ` [PATCH uprobe, thp v2 2/5] uprobe: use original page when all uprobes are removed Song Liu
2019-06-05 10:02   ` Oleg Nesterov
2019-06-05 16:29     ` Song Liu
2019-06-04 16:51 ` [PATCH uprobe, thp v2 3/5] mm, thp: introduce FOLL_SPLIT_PMD Song Liu
2019-06-04 16:51 ` [PATCH uprobe, thp v2 4/5] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT Song Liu
2019-06-04 16:51 ` [PATCH uprobe, thp v2 5/5] uprobe: collapse THP pmd after removing all uprobes Song Liu

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).