All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Vince Weaver <vince@deater.net>
Cc: Vince Weaver <vweaver1@eecs.utk.edu>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, paulus@samba.org,
	acme@redhat.com
Subject: Re: perf: [patch] regression with PERF_EVENT_IOC_REFRESH
Date: Tue, 31 May 2011 17:52:53 +0200	[thread overview]
Message-ID: <1306857173.2353.162.camel@twins> (raw)
In-Reply-To: <Pine.LNX.4.64.1105310942410.9995@pianoman.cluster.toy>

On Tue, 2011-05-31 at 09:49 -0400, Vince Weaver wrote:
> On Tue, 31 May 2011, Peter Zijlstra wrote:
> 
> > On Mon, 2011-05-30 at 21:33 -0400, Vince Weaver wrote:
> > > the problem was the mentioned commit tried to optimize the use of 
> > > watermark and wakeup_watermark without taking into account that 
> > > wakeup_watermark is a union with wakeup_events. 
> > 
> > Note that wake_events isn't related to IOC_REFRESH, wake_events is how
> > much events to buffer in the mmap-buffer before issuing a wakeup.
> > 
> > IOC_REFRESH increments event_limit, which is how many events to run
> > before disabling yourself.
> > 
> > What I gather is that due to that SIGIO bug (fixed by f506b3dc0e), you
> > had to have both an mmap and a wakeup in order for that signal to
> > arrive.
> 
> yes, but due to a bug in the mentioned changeset, the buffer watermark 
> value was being set to a low value even if *watermark* was 0.  So if you 
> were using IOC_REFRESH to set the *wakeup_events* value,

IOC_REFRESH sets event->event_limit, not wakeup_events.

>  it was also 
> setting the *wakeup_watermark* value (it's a union) and the buffer setup 
> was then unconditionally setting the buffer watermark to the value of the 
> supposedly unrelated *wakeup_watermark*.  Normally the wakeup watermark 
> would default to something like 2048, but if you were trying to set the 
> wakeup_events value to something like 3 then wakeup_watermark would be set 
> to that too, causing a lot more overflow events.

poll() wakeups, which were inadvertly linked to SIGIOs

> I verified all the above painfully using a lot of printks.

I prefer to use trace_printk() and /debug/tracing/, that doesn't slow
stuff down as much.

> I agree this does seem to be a combination of bugs, as even with a 
> properlyu set value on affected kernels you'd get spurious watermark 
> overflow events if you weren't consuming the ring buffer.

*nod*

> In any case, I can provide a cleaner patch than the one before that isn't 
> as intrusive.

Appreciated.

> I'm also bisecting the other problem I mentioned, the one where overflows 
> are 10x too large on 3.0-rc1.  I'm at work with a Nehalem machine so the 
> bisect should go faster than the bisect I had to do on an atom machine 
> this weekend.  

It wouldn't be the SIGIO fix would it?, with that every overflow
generates a SIGIO, not only the poll() wakeups. And ouch at bisecting
(or even building a kernel) on an Atom, those things are horridly slow.

> A power outage over the weekend has taken part of the 
> network down here though so my e-mail access is a bit limited, so I 
> apologize if I've been missing comments sent to my other e-mail address.

I'm afraid not, I've been mostly tied up with fixing some scheduler
regressions.

Also, it looks like I just broke stuff even worse in -tip, am bisecting
that now.

  reply	other threads:[~2011-05-31 22:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 20:04 perf: regression with PERF_EVENT_IOC_REFRESH Vince Weaver
2011-05-23 20:22 ` Peter Zijlstra
2011-05-24  6:20   ` Vince Weaver
2011-05-24 10:30     ` Peter Zijlstra
2011-05-24 15:04       ` Vince Weaver
2011-05-24 15:10         ` Peter Zijlstra
2011-05-24 15:40           ` Ingo Molnar
2011-05-24 20:31             ` Vince Weaver
2011-05-25 10:39               ` Ingo Molnar
2011-05-25 21:24                 ` Vince Weaver
2011-05-24 17:53           ` Vince Weaver
2011-05-24 15:11         ` Peter Zijlstra
2011-05-24 15:18           ` Peter Zijlstra
2011-05-24 21:48             ` Vince Weaver
2011-05-28  3:38       ` Vince Weaver
2011-05-28 10:22         ` Peter Zijlstra
2011-05-28 13:26           ` perf: definition of a "regression" Vince Weaver
2011-06-02  7:45             ` Ingo Molnar
2011-05-29 16:54           ` perf: regression with PERF_EVENT_IOC_REFRESH Vince Weaver
2011-05-31  1:33             ` perf: [patch] " Vince Weaver
2011-05-31  7:17               ` Peter Zijlstra
2011-05-31  7:23               ` Peter Zijlstra
2011-05-31 13:49                 ` Vince Weaver
2011-05-31 15:52                   ` Peter Zijlstra [this message]
2011-05-31 16:39                     ` Vince Weaver

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=1306857173.2353.162.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=vince@deater.net \
    --cc=vweaver1@eecs.utk.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.