From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755002AbdC1VaL convert rfc822-to-8bit (ORCPT ); Tue, 28 Mar 2017 17:30:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58110 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667AbdC1VaJ (ORCPT ); Tue, 28 Mar 2017 17:30:09 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6002F81243 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lcapitulino@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6002F81243 Date: Tue, 28 Mar 2017 17:30:05 -0400 From: Luiz Capitulino To: Rik van Riel Cc: Wanpeng Li , Frederic Weisbecker , linux-kernel@vger.kernel.org Subject: Re: [BUG nohz]: wrong user and system time accounting Message-ID: <20170328173005.5b3e2972@redhat.com> In-Reply-To: <1490736251.8850.87.camel@redhat.com> References: <20170323165512.60945ac6@redhat.com> <1490636129.8850.76.camel@redhat.com> <20170328132406.7d23579c@redhat.com> <20170328161454.4a5d9e8b@redhat.com> <1490736251.8850.87.camel@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 28 Mar 2017 21:30:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Mar 2017 17:24:11 -0400 Rik van Riel wrote: > On Tue, 2017-03-28 at 16:14 -0400, Luiz Capitulino wrote: > > > And I think I was right, it looks like the nohz code is programming > > the tick period incorrectly when restarting the tick. The patch below > > fixes things for me, but I still have some homework todo and more > > testing before posting a patch for inclusion. Could you guys test it? > > I spoke too soon. After half an hour of runtime, > things have gotten aligned to give me about 50/50 > user time and system time with your test case, > again. Hmmm, maybe it's incomplete. I still think that nohz might screwing something up when re-activating the tick. > > This is on an 8 VCPU virtual machine, with > nohz_full=2-7, and the test case running on one > of the nohz_full CPUs. > > > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > > index 7fe53be..9abe979 100644 > > --- a/kernel/time/tick-sched.c > > +++ b/kernel/time/tick-sched.c > > @@ -1152,6 +1152,7 @@ static enum hrtimer_restart > > tick_sched_timer(struct hrtimer *timer) > >         struct pt_regs *regs = get_irq_regs(); > >         ktime_t now = ktime_get(); > >   > > +       ts->last_tick = now; > >         tick_sched_do_timer(now); > >   > >         /* >