All of lore.kernel.org
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>
Cc: <oleg@redhat.com>, <rostedt@goodmis.org>, <mhiramat@kernel.org>,
	<matthew.wilcox@oracle.com>, <kirill.shutemov@linux.intel.com>,
	<kernel-team@fb.com>, Song Liu <songliubraving@fb.com>
Subject: [PATCH v4 4/5] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT
Date: Thu, 13 Jun 2019 10:57:46 -0700	[thread overview]
Message-ID: <20190613175747.1964753-5-songliubraving@fb.com> (raw)
In-Reply-To: <20190613175747.1964753-1-songliubraving@fb.com>

This patches uses newly added FOLL_SPLIT_PMD in uprobe. This enables easy
regroup of huge pmd after the uprobe is disabled (in next patch).

Signed-off-by: Song Liu <songliubraving@fb.com>
---
 kernel/events/uprobes.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index f7c61a1ef720..a20d7b43a056 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -153,7 +153,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
 {
 	struct mm_struct *mm = vma->vm_mm;
 	struct page_vma_mapped_walk pvmw = {
-		.page = old_page,
+		.page = compound_head(old_page),
 		.vma = vma,
 		.address = addr,
 	};
@@ -165,8 +165,6 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr,
 	mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, mm, addr,
 				addr + PAGE_SIZE);
 
-	VM_BUG_ON_PAGE(PageTransHuge(old_page), old_page);
-
 	if (!orig) {
 		err = mem_cgroup_try_charge(new_page, vma->vm_mm, GFP_KERNEL,
 					    &memcg, false);
@@ -483,7 +481,7 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm,
 retry:
 	/* Read the page with vaddr into memory */
 	ret = get_user_pages_remote(NULL, mm, vaddr, 1,
-			FOLL_FORCE | FOLL_SPLIT, &old_page, &vma, NULL);
+			FOLL_FORCE | FOLL_SPLIT_PMD, &old_page, &vma, NULL);
 	if (ret <= 0)
 		return ret;
 
-- 
2.17.1


  parent reply	other threads:[~2019-06-13 17:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 17:57 [PATCH v4 0/5] THP aware uprobe Song Liu
2019-06-13 17:57 ` [PATCH v4 1/5] mm: move memcmp_pages() and pages_identical() Song Liu
2019-06-13 17:57 ` [PATCH v4 2/5] uprobe: use original page when all uprobes are removed Song Liu
2019-06-13 17:57 ` [PATCH v4 3/5] mm, thp: introduce FOLL_SPLIT_PMD Song Liu
2019-06-21 12:44   ` Kirill A. Shutemov
2019-06-21 14:08     ` Song Liu
2019-06-13 17:57 ` Song Liu [this message]
2019-06-13 17:57 ` [PATCH v4 5/5] uprobe: collapse THP pmd after removing all uprobes Song Liu
2019-06-21 12:48   ` Kirill A. Shutemov
2019-06-21 13:17     ` Song Liu
2019-06-21 13:36       ` Kirill A. Shutemov
2019-06-21 13:45         ` Song Liu
2019-06-21 16:30           ` Song Liu
2019-06-21 18:04             ` Song Liu
2019-06-24 12:34               ` Kirill A. Shutemov
2019-06-24 13:53                 ` Song Liu
2019-06-17  4:27 ` [PATCH v4 0/5] THP aware uprobe Song Liu
2019-06-17  4:27   ` Song Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613175747.1964753-5-songliubraving@fb.com \
    --to=songliubraving@fb.com \
    --cc=kernel-team@fb.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.wilcox@oracle.com \
    --cc=mhiramat@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.