lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161026152454.GA1186@krava>
Date:   Wed, 26 Oct 2016 17:24:55 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     "Huang, Ying" <ying.huang@...el.com>,
        kernel test robot <xiaolong.ye@...el.com>,
        Michael Neuling <mikey@...ling.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        lkp@...org, lkml <linux-kernel@...r.kernel.org>,
        Jan Stancek <jstancek@...hat.com>,
        Paul Mackerras <paulus@...ba.org>,
        Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCHv3] perf powerpc: Don't call perf_event_disable from
 atomic context

On Wed, Oct 26, 2016 at 05:12:49PM +0200, Peter Zijlstra wrote:
> On Wed, Oct 26, 2016 at 11:48:24AM +0200, Jiri Olsa wrote:
> 
> > diff --git a/kernel/events/core.c b/kernel/events/core.c
> > index c6e47e97b33f..04477983945e 100644
> > --- a/kernel/events/core.c
> > +++ b/kernel/events/core.c
> > @@ -1960,6 +1960,13 @@ void perf_event_disable(struct perf_event *event)
> >  }
> >  EXPORT_SYMBOL_GPL(perf_event_disable);
> >  
> > +void perf_event_disable_inatomic(struct perf_event *event, int kill)
> > +{
> > +	event->pending_kill    = kill;
> > +	event->pending_disable = 1;
> > +	irq_work_queue(&event->pending);
> > +}
> > +
> >  static void perf_set_shadow_time(struct perf_event *event,
> >  				 struct perf_event_context *ctx,
> >  				 u64 tstamp)
> > @@ -7074,9 +7081,7 @@ static int __perf_event_overflow(struct perf_event *event,
> >  	event->pending_kill = POLL_IN;
> >  	if (events && atomic_dec_and_test(&event->event_limit)) {
> >  		ret = 1;
> > -		event->pending_kill = POLL_HUP;
> > -		event->pending_disable = 1;
> > -		irq_work_queue(&event->pending);
> > +		perf_event_disable_inatomic(event, POLL_HUP);
> >  	}
> 
> So the pending_kill stuff is independent of the disable here. No need to
> combine the two. I've change the patch as per the below.
> 
> That is, pending_kill is part of pending_wakeup, not of pending_disable.
> Here we simply use both, its just that on disable we need a different
> kind of wakeup (HANGUP instead of IN).
> 
> See how after ->overflow_handler() we send a wakeup if there's a
> registered signal.

ok, seems good

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ