Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp598817ybx; Wed, 30 Oct 2019 01:50:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4xQUuVlJvSZ1eGMMMrvO54YM5iAaMD4XctsSDnaQTEIq1iak1pBoD0gHyBZObUJZxrb+c X-Received: by 2002:aa7:dc1a:: with SMTP id b26mr30491428edu.139.1572425406587; Wed, 30 Oct 2019 01:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572425406; cv=none; d=google.com; s=arc-20160816; b=I6zeJBe11Hz2qiHKx6K+ym1Q3vEzkflMQCQT2d2B30PDv8wmuuuFzQguP475wU5Gti QHZBBtMFzTpUUUIccCv4ao1MD6SNvuNt1J7a2njN097sABnawA+c2jxc/Qb33K+x3wNv YdZmfgahVKTha2lDipkTHWBi5733+SPN2ON2EruSRI3zJk1YVc46+9UAYtWSDGT7ZOKg VESqGery5DIzX//RrGtNlWC179HzWI7uMZj4Fz3IWLUcwm4BduVWCpEdRJEpiGbRTgFO vSFx8HnmpqT9ch1m8fSpJN1jypjwhVyhsQhkC2eLTAGXcd/lCKaER6fp9ZlJ5QCu10Cj WDvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=nxeEn5vTSgM9eH45CLFbxbgOktGOR7e/qmHK5tiEGJk=; b=SNQjJIzjT/LUkhkbkQOMux968MZs8JWnvZSh8cxadc9q2zuLf4ayvQLP0TLOqeRAOX FZHVxFbMTwaeQPXUsG5ZgxS6266AQaVr+HRXQDFV3UlAkvA4VetAoeExhZW35Zws8NxM lE+mYgGjTkMX4rm9qx2bS+Z4+V2tizeyj48K16X1IEt7XWy2rSUaRt5lvyPY2+xGvzs3 vul3xu9OTrugkdOq88gY6IA++4FWl5921WSIEeJO72AcdF9un8VjmNMmj7/2TIxIPNgg pettlmnmdTkWEJ6R560XX1DmAPndzxMqjiXIWLjjKkaJwTgJJfMiag8/GDi9Hs+okbwA gM3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IssXzYXl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qt19si799589ejb.5.2019.10.30.01.49.42; Wed, 30 Oct 2019 01:50:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IssXzYXl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbfJ3Isd (ORCPT + 99 others); Wed, 30 Oct 2019 04:48:33 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:49871 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726028AbfJ3Isd (ORCPT ); Wed, 30 Oct 2019 04:48:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572425311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nxeEn5vTSgM9eH45CLFbxbgOktGOR7e/qmHK5tiEGJk=; b=IssXzYXl9/vHSxtrz5a68oG78qscf2mKO/J9CYeJrw5mBGzptdjsUbE672flCahWg+PFUN zih+z7Xz0h07ZzStsMHxhsGBQ+hvdSOr52q7kxTsAPG9vAtADRlOM0yhcB2JWCNq47XpKS PKBbjBx+6aqjUiXb+XcwgkLK81Q4LmM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-uXwssujUOo-NFLOe28wEEA-1; Wed, 30 Oct 2019 04:48:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4808481A334; Wed, 30 Oct 2019 08:48:27 +0000 (UTC) Received: from ovpn-116-229.phx2.redhat.com (ovpn-116-229.phx2.redhat.com [10.3.116.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA6BE5D6D8; Wed, 30 Oct 2019 08:48:26 +0000 (UTC) Message-ID: <52d963553deda810113accd8d69b6dffdb37144f.camel@redhat.com> Subject: Re: [PATCH] timers/nohz: Update nohz load even if tick already stopped From: Scott Wood To: Peter Zijlstra , Frederic Weisbecker Cc: Thomas Gleixner , Ingo Molnar , LKML Date: Wed, 30 Oct 2019 03:48:26 -0500 In-Reply-To: <20191029100506.GJ4114@hirez.programming.kicks-ass.net> References: <20191028150716.22890-1-frederic@kernel.org> <20191029100506.GJ4114@hirez.programming.kicks-ass.net> Organization: Red Hat User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: uXwssujUOo-NFLOe28wEEA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-10-29 at 11:05 +0100, Peter Zijlstra wrote: > On Mon, Oct 28, 2019 at 04:07:16PM +0100, Frederic Weisbecker wrote: > > From: Scott Wood > >=20 > > The way loadavg is tracked during nohz only pays attention to the load > > upon entering nohz. This can be particularly noticeable if nohz is > > entered while non-idle, and then the cpu goes idle and stays that way > > for > > a long time. We've had reports of a loadavg near 150 on a mostly idle > > system. > >=20 > > Calling calc_load_nohz_start() regardless of whether the tick is alread= y > > stopped addresses the issue when going idle. Tracking load changes when > > not going idle (e.g. multiple SCHED_FIFO tasks coming and going) is not > > addressed by this patch. >=20 > Hurph, is that phenomena you describe NOHZ or NOHZ_FULL? Because that > second thing you talk about, multiple SCHED_FIFO tasks running without a > tick is definitely NOHZ_FULL. >=20 > I'm thinking all of this is NOHZ_FULL because IIRC we always start the > tick when there is a runnable task. So your example of going idle in > NOHZ already cannot happen for regular NOHZ. Yes, NOHZ_FULL (sorry for not stating that clearly). > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index eb42b71faab9..209e50d48f80 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3666,6 +3666,8 @@ static void sched_tick_remote(struct work_struct > *work) > =09 * having one too much is no big deal because the scheduler tick > updates > =09 * statistics and checks timeslices in a time-independent way, > regardless > =09 * of when exactly it is running. > +=09 * > +=09 * XXX should we be checking tick_nohz_tick_stopped_cpu() under rq- > >lock ? > =09 */ > =09if (idle_cpu(cpu) || !tick_nohz_tick_stopped_cpu(cpu)) > =09=09goto out_requeue; > @@ -3686,6 +3688,7 @@ static void sched_tick_remote(struct work_struct > *work) > =09curr->sched_class->task_tick(rq, curr, 0); > =20 > out_unlock: > +=09calc_load_nohz_remote(cpu); > =09rq_unlock_irq(rq, &rf); This gets skipped when the cpu is idle, so it still misses the update. -Scott