lkml.org 
[lkml]   [2013]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: OOPS in perf_mmap_close()
On Thu, May 23, 2013 at 07:40:12PM -0400, Vince Weaver wrote:
> On Thu, 23 May 2013, Peter Zijlstra wrote:
>
> > On Thu, May 23, 2013 at 10:10:36AM -0400, Vince Weaver wrote:
> > >
> > > I can confirm your patch avoids the oops on my machine.
> > >
> > > It does lead to interesting behavior if I run the sample program
> > > multiple times (with added printfs):
> > >
> > > vince@core2:~$ ./perf_mmap_close_bug
> > > mmap1=0x7f06a6e90000
> > > mmap2=0x7f06a6e7f000
> > > vince@core2:~$ ./perf_mmap_close_bug
> > > mmap1=0x7f878a138000
> > > mmap2=0x7f878a127000
> > > vince@core2:~$ ./perf_mmap_close_bug
> > > mmap1=0xffffffffffffffff
> > > Error opening fd2 Invalid argument
> > >
> > > and then it never successfully completes again. Is this unexpected
> > > behavior?
> >
> > Sounds weird to me, I'll see if I can reproduce/understand.
>
> I tracked this down in case you haven't already.
>
> The problem is that in the kernel patched
> with your patch locked_vm is getting decremented twice in the sample code
> and going negative. I'm not sure why this isn't a problem until the
> third time through. Here are my crude debug printk
> results from kernel/events/core.c

D'uh I think I see what's happening.. we haev split the mmap state
between the ringbuffer and event objects and since we have two events
and one ringbuffer we're hosed.

Let me try and straighten this out.


\
 
 \ /
  Last update: 2013-05-24 12:01    [W:0.303 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site