Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 7:28 AM, Oleg Nesterov wrote: > > On 10/17, Song Liu wrote: >> >> >>> On Oct 17, 2019, at 1:47 AM, Oleg Nesterov wrote: >>> >>> On 10/16, Song Liu wrote: > On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: > >> @@ -489,6 +492,9 @@ int uprobe_write_

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Oleg Nesterov
On 10/17, Song Liu wrote: > > > > On Oct 17, 2019, at 1:47 AM, Oleg Nesterov wrote: > > > > On 10/16, Song Liu wrote: > >> > >>> On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: > >>> > @@ -489,6 +492,9 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, > struct mm_struct *mm, >

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Song Liu
> On Oct 17, 2019, at 1:47 AM, Oleg Nesterov wrote: > > On 10/16, Song Liu wrote: >> >>> On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: >>> @@ -489,6 +492,9 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, struct mm_struct *mm, if (ret <= 0) goto

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-17 Thread Oleg Nesterov
On 10/16, Song Liu wrote: > > > On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: > > > >> @@ -489,6 +492,9 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, > >> struct mm_struct *mm, > >>if (ret <= 0) > >>goto put_old; > >> > >> + WARN(!is_register && PageCompound(old_pag

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-16 Thread Song Liu
> On Oct 16, 2019, at 5:10 AM, Oleg Nesterov wrote: > > On 10/16, Song Liu wrote: >> >> --- a/kernel/events/uprobes.c >> +++ b/kernel/events/uprobes.c >> @@ -474,14 +474,17 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, >> struct mm_struct *mm, >> struct vm_area_struct *vma; >>

Re: [PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-16 Thread Oleg Nesterov
On 10/16, Song Liu wrote: > > --- a/kernel/events/uprobes.c > +++ b/kernel/events/uprobes.c > @@ -474,14 +474,17 @@ int uprobe_write_opcode(struct arch_uprobe *auprobe, > struct mm_struct *mm, > struct vm_area_struct *vma; > int ret, is_register, ref_ctr_updated = 0; > bool orig_

[PATCH 4/4] uprobe: only do FOLL_SPLIT_PMD for uprobe register

2019-10-16 Thread Song Liu
Attaching uprobe to text section in THP splits the PMD mapped page table into PTE mapped entries. On uprobe detach, we would like to regroup PMD mapped page table entry to regain performance benefit of THP. However, the regroup is broken For perf_event based trace_uprobe. This is because perf_even