From: Will Deacon <will.deacon@arm.com>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/aux: Only update aux_wakeup in non-overwrite mode
Date: Thu, 28 Sep 2017 12:29:15 +0100 [thread overview]
Message-ID: <20170928112915.GB24145@arm.com> (raw)
In-Reply-To: <87fubqx4ys.fsf@ashishki-desk.ger.corp.intel.com>
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
next prev parent reply other threads:[~2017-09-28 11:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 16:08 Alexander Shishkin
2017-09-12 22:37 ` Will Deacon
2017-09-13 10:34 ` Alexander Shishkin
2017-09-28 11:29 ` Will Deacon [this message]
2017-09-28 11:40 ` Peter Zijlstra
2017-09-29 9:28 ` [tip:perf/urgent] perf/aux: Only update ->aux_wakeup " tip-bot for Alexander Shishkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170928112915.GB24145@arm.com \
--to=will.deacon@arm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome