Message ID | 20190625235325.2096441-5-songliubraving@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | THP aware uprobe | expand |
* Song Liu <songliubraving@fb.com> [2019-06-25 16:53:25]: > 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). > > Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> > Signed-off-by: Song Liu <songliubraving@fb.com> > --- > kernel/events/uprobes.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Looks good to me. Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> On Jun 25, 2019, at 11:00 PM, Srikar Dronamraju <srikar@linux.vnet.ibm.com> wrote: > > * Song Liu <songliubraving@fb.com> [2019-06-25 16:53:25]: > >> 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). >> >> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> >> Signed-off-by: Song Liu <songliubraving@fb.com> >> --- >> kernel/events/uprobes.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) > > Looks good to me. > > Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Thanks Srikar! I guess these 4 patches are ready to go? Hi Andrew, Could you please route them via the mm tree? Thanks, Song
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;