Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933025AbdDEO1s (ORCPT ); Wed, 5 Apr 2017 10:27:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbdDEO1B (ORCPT ); Wed, 5 Apr 2017 10:27:01 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8C69AC04D2BC Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=riel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8C69AC04D2BC Message-ID: <1491402411.16856.5.camel@redhat.com> Subject: Re: [BUG nohz]: wrong user and system time accounting From: Rik van Riel To: Luiz Capitulino , Frederic Weisbecker Cc: Wanpeng Li , Mike Galbraith , "linux-kernel@vger.kernel.org" , Peter Zijlstra , Thomas Gleixner Date: Wed, 05 Apr 2017 10:26:51 -0400 In-Reply-To: <20170404133638.178b29f7@redhat.com> References: <1490818125.28917.11.camel@redhat.com> <1490848051.4167.57.camel@gmx.de> <20170330133802.GC3626@lerouge> <20170330141816.GE3626@lerouge> <20170330172546.4e8e1a6a@redhat.com> <20170331160910.0dda403e@redhat.com> <20170331232452.GA10607@lerouge> <20170331231119.2b78eb1f@redhat.com> <20170403152315.GA4221@lerouge> <20170403150613.77541109@redhat.com> <20170404133638.178b29f7@redhat.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-UaDY7zjYiai7YIvuEIR5" Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 05 Apr 2017 14:27:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2561 Lines: 68 --=-UaDY7zjYiai7YIvuEIR5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2017-04-04 at 13:36 -0400, Luiz Capitulino wrote: >=C2=A0 > On further debugging this, I realized that I had overlooked > something: > the timer interrupt in this trace is not the tick, but cyclictest's > timer > (remember that the test-case consists of pinning cyclictest and a > task > hogging the CPU to the same CPU). >=20 > I'm running cyclictest with -i 200. If I increase this to -i 1000, > then > I seem unable to reproduce the issue (caution: even with -i 200 it > doesn't always happen. But it does usually happen after I restart the > test-case a few times. However, I've never been able to reproduce > with -i 1000). >=20 > Now, if it's really cyclictest that's causing the timer interrupts to > get aligned, I guess this might not have a solution? (note: I haven't > been able to reproduce this on bare-metal). With any sample (tick) based timekeeping, it is possible to construct workloads that avoid the sampling and result in skewed statistics as a result. However, given that local users can already DoS the system in all kinds of ways, skewed statistics are probably not that high up on the list of importance. If there were a way to do accurate accounting (true vtime accounting) without increasing the overhead of every syscall and interrupt noticeably, that might be worth it, but syscall overhead is likely to be a more important factor than the accuracy of statistics. I don't know if doing TSC reads and subtraction/addition only, and delaying the conversion to cputime until a later point would slow down system calls measurably, compared with reading jiffies and comparing it against a cached value of jiffies, nor do I know whether spending time implementing and testing that would be worthwhile :) --=20 All rights reversed --=-UaDY7zjYiai7YIvuEIR5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJY5P6rAAoJEM553pKExN6DfNkH/AzccvzSHlOozVU9BNNMVPqb Cex04shUpnP8XFMEc03jHMNZdkpP3U4eUEYKu7RzU+pP4tql1ngvyhOvFja4zp5W Mk1yWyVy81yaZHaDml1E6dIfBdwRAhh1JX1/RbDr6Of2KtA7fws0Dyoh+RhVM5ms Aqy4R/n+VKJaChTmCGWDsbWhdkFcfZ+HGfTEXZQvSi/9iKxfGsYH4U4t3tcVfi7B FV9afmet2CdZuruvbC6wBBcGzaD80nhhJIhW+7IfmJvRHIjzV9LLGXlVSUbwkELb lFTZaJV9hNCWicpvT6uYoMRWOu9Y/SW4J4nGCYdw2MwqBPMPaYQWLmY61LJcD18= =kQv5 -----END PGP SIGNATURE----- --=-UaDY7zjYiai7YIvuEIR5--