lkml.org 
[lkml]   [2017]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/aux: Only update aux_wakeup in non-overwrite mode
Hi Alexander,

On Wed, Sep 13, 2017 at 01:34:03PM +0300, Alexander Shishkin wrote:
> Will Deacon <will.deacon@arm.com> writes:
> > On Wed, Sep 06, 2017 at 07:08:11PM +0300, Alexander Shishkin wrote:
> >> Commit d9a50b0256 ("perf/aux: Ensure aux_wakeup represents most recent
> >> wakeup index") changed aux wakeup position calculation to rounddown(),
> >> which causes a division-by-zero in AUX overwrite mode (aka "snapshot
> >> mode").
> >>
> >> The zero denominator results from the fact that perf record doesn't set
> >> aux_watermark to anything, in which case the kernel will set it to half
> >> the AUX buffer size, but only for non-overwrite mode. In the overwrite
> >> mode aux_watermark stays zero.
> >>
> >> The good news is that, AUX overwrite mode, wakeups don't happen and
> >> related bookkeeping is not relevant, so we can simply forego the whole
> >> wakeup updates.
> >>
> >> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> >> ---
> >> kernel/events/ring_buffer.c | 20 +++++++++++++++-----
> >> 1 file changed, 15 insertions(+), 5 deletions(-)
> >
> > Damn, sorry about that. How did you spot the problem?
>
> A normal perf record with -S should trigger it, I don't remember what
> exactly I was doing at that moment. But no worries, we all missed it the
> first time around. :)
>
> > Anyway, I think the code is much better with this factored out:
> >
> > Acked-by: Will Deacon <will.deacon@arm.com>
>
> Thanks!

What's the status on this patch? I don't see it in mainline or linux-next,
but it would ideally get in as a fix for 4.14.

Will

\
 
 \ /
  Last update: 2017-09-28 13:30    [W:0.039 / U:1.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site