Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Peter Zijlstra
On Thu, Oct 17, 2013 at 08:24:17PM +0200, Oleg Nesterov wrote: > Subject: [PATCH] perf: Factor out strncpy() in perf_event_mmap_event() > From: Oleg Nesterov > Date: Thu, 17 Oct 2013 20:04:17 +0200 > > While this is really minor, but strncpy() does the unnecessary > zero-padding till the end of t

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Oleg Nesterov
On 10/17, Peter Zijlstra wrote: > > - name = arch_vma_name(vma); > + name = (char *)arch_vma_name(vma); Yes, this way we do not need another non-const ptr. OK, please consider another cleanup on top of this change. Just to "complete" the discussion, do not even bother to

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Peter Zijlstra
On Thu, Oct 17, 2013 at 05:27:17PM +0200, Oleg Nesterov wrote: > On 10/17, Oleg Nesterov wrote: > > > > - we do not really need "len", we can simply do > > > > size = strlen(name) + 1; > > while (size % sizeof(u64)) > > name[size++] = '\0'; > > > >

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Peter Zijlstra
On Thu, Oct 17, 2013 at 05:20:27PM +0200, Oleg Nesterov wrote: > On 10/16, Peter Zijlstra wrote: > > > > On Wed, Oct 16, 2013 at 10:58:00PM +0200, Oleg Nesterov wrote: > > > OK. I'll wait for your review on this series, then send the next patch. > > > > > > > Those two patches look good; thanks. >

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Oleg Nesterov
On 10/17, Oleg Nesterov wrote: > > - we do not really need "len", we can simply do > > size = strlen(name) + 1; > while (size % sizeof(u64)) > name[size++] = '\0'; > > although I won't argue if you dislike "size & 7" in while(). Or, p

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-17 Thread Oleg Nesterov
On 10/16, Peter Zijlstra wrote: > > On Wed, Oct 16, 2013 at 10:58:00PM +0200, Oleg Nesterov wrote: > > OK. I'll wait for your review on this series, then send the next patch. > > > > Those two patches look good; thanks. Thanks, can I have your acks for Ingo ? > How about something like so on top?

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Peter Zijlstra
On Wed, Oct 16, 2013 at 10:58:00PM +0200, Oleg Nesterov wrote: > OK. I'll wait for your review on this series, then send the next patch. > Those two patches look good; thanks. How about something like so on top? --- --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -5103,18 +5103,16 @@ st

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Oleg Nesterov
On 10/16, Peter Zijlstra wrote: > > On Wed, Oct 16, 2013 at 10:43:48PM +0200, Oleg Nesterov wrote: > > Peter, just in case. I understand that this all is minor. Just I am > > confused. And in any case I do think we do not need __GFP_ZERO when > > it comes to PAGE_SIZE allocation. > > Yeah; we could

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Oleg Nesterov
On 10/16, Peter Zijlstra wrote: > > On Wed, Oct 16, 2013 at 10:43:48PM +0200, Oleg Nesterov wrote: > > Yes, we can copy the garbage to the userspace. So what? This should not > > matter at all. Exactly because userspace should never used the data after > > the end of string, no? > > Security people

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Peter Zijlstra
On Wed, Oct 16, 2013 at 10:43:48PM +0200, Oleg Nesterov wrote: > Peter, just in case. I understand that this all is minor. Just I am > confused. And in any case I do think we do not need __GFP_ZERO when > it comes to PAGE_SIZE allocation. Yeah; we could probably avoid it; if only the strcpy functi

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Peter Zijlstra
On Wed, Oct 16, 2013 at 10:43:48PM +0200, Oleg Nesterov wrote: > Yes, we can copy the garbage to the userspace. So what? This should not > matter at all. Exactly because userspace should never used the data after > the end of string, no? Security people tell me to _never_ leak anything. I'm not ne

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Oleg Nesterov
On 10/16, Peter Zijlstra wrote: > > On Wed, Oct 16, 2013 at 10:09:24PM +0200, Oleg Nesterov wrote: > > OK, so I think this code should die, it only adds the confusion. > > > > Note also that at least on x86_64 "[vdso]" is not correct (if !vma_mm > > was possible), this adds more confusion. > > Righ

Re: [PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Peter Zijlstra
On Wed, Oct 16, 2013 at 10:09:24PM +0200, Oleg Nesterov wrote: > OK, so I think this code should die, it only adds the confusion. > > Note also that at least on x86_64 "[vdso]" is not correct (if !vma_mm > was possible), this adds more confusion. Right, but x86_64 will return [vsyscall] and we'll

[PATCH 0/2] (Was: perf_event_mmap(vma) && !vma->vm_mm)

2013-10-16 Thread Oleg Nesterov
Peter, you know, I was going to forget about this, but then I looked at perf_event_mmap_event() again and I am even more puzzled. I believe it asks for cleanups. On 10/14, Peter Zijlstra wrote: > > On Sat, Oct 12, 2013 at 09:22:03PM +0200, Oleg Nesterov wrote: > > > > But please ignore, the only