Re: [PATCH 3/4 v2] nohz: Fix idle/iowait counts going backwards

From: Peter Zijlstra
Date: Wed May 07 2014 - 12:56:58 EST


On Wed, May 07, 2014 at 06:49:47PM +0200, Denys Vlasenko wrote:
> On 05/07/2014 04:23 PM, Peter Zijlstra wrote:
> > On Wed, May 07, 2014 at 03:41:33PM +0200, Denys Vlasenko wrote:
> >> With this change, "iowait-ness" of every idle period is decided
> >> at the moment it starts:
> >> if this CPU's run-queue had tasks waiting on I/O, then this idle
> >> period's duration will be added to iowait_sleeptime.
> >>
> >> This fixes the bug where iowait and/or idle counts could go backwards,
> >> but iowait accounting is not precise (it can show more iowait
> >> that there really is).
> >>
> >
> > NAK on this, the thing going backwards is a symptom of the bug, not an
> > actual bug itself.
>
> This patch does fix that bug.

Which bug, there's two here:

1) that NOHZ and !NOHZ iowait accounting aren't identical
2) that iowait accounting in general is a steaming pile of crap

Those are the only two bugs around. If you want easy, you get to fix 1,
if you want to do hard you try and fix 2.

iowait going backwards is a symptom of NOHZ iowait accounting being
broken -- as compared to !NOHZ.

Just stopping it from going backwards is not a fix for anything except
papering over symptoms, and if you thing that's a good approach to
software engineering then I'll welcome you to my killfile.

Attachment: pgpFc_TwGOpY4.pgp
Description: PGP signature