Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1116080ybl; Wed, 11 Dec 2019 12:47:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzrNBORHLY2tArHYEiV/0ursZdZzjmBHO1pE9j1HXxOFVnQwhEIpHyudV9Pf9ERlhuXdS2s X-Received: by 2002:a05:6830:12d0:: with SMTP id a16mr4026276otq.8.1576097232519; Wed, 11 Dec 2019 12:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576097232; cv=none; d=google.com; s=arc-20160816; b=jXWy1MBOiMGahYzLcM2+1UATso5NYMFob/n9lxpGRV/FrCZddUcW0Yxjx/fjV69s+C 86OoyWddAlFbGE6w/PAF4qhIYiBz776TvEc2Aggw737WzFZJtERMigDccprYvT8eQcQw lJ0zYWaeMTrkibq+9VrDBnRQCjYyIu1PXq47B+beVDSApPGV/OeB6RbsEEUIQgZSCvlt quCaM1S/Xchdtmg5GCbNBTeggBpmMxwXKrBfhbNrSi5aM0i8hPh8AEWu/hnXsnyV70yx 5B97u/G+A+HfWwReAdZwLAKjvlEk3XUJZW9nv0eXiIkkPZ0j8QjGGFOraY6AFHm7N5ap zvKQ== 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=RdRBEoYxRIkuYEuDHr3V4GvXlKW2Lf5ylOPLl+U6EFw=; b=zCKAoY2ZAsHweBZA+PIGGvsNCQ4ic2pmzVIHq6bX2iEE+ACGlRf6ayu08wkNEz3ECC SX0dfZDWL3rB/9j3H1po1f8rfKv2AgjtlY0o3SVVnJxGs/br6nfd+m9sksqZxRiEbzM8 klbDAoD0iZVl/e1cCCbhBFO8VS2zhFw9Du99es+4cI1TpLKx+a+0EdIOUEcNj8jwH2jD Q5ceHkCQpqJoN+uubCN+nZPm1S6uCm0Tlg9kz2LJkTgzIhscNiRMrP2wOhV/UQehz7vO Fczm43dYRlTdhGewQlMG7biSgepHxBjL9hu+wosvqjXA9HAc7I/7KdNfCNJ598RhB5bn agvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JeERaHUw; 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 t12si1857557otm.224.2019.12.11.12.47.00; Wed, 11 Dec 2019 12:47:12 -0800 (PST) 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=JeERaHUw; 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 S1726955AbfLKUqJ (ORCPT + 99 others); Wed, 11 Dec 2019 15:46:09 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:32225 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726925AbfLKUqH (ORCPT ); Wed, 11 Dec 2019 15:46:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576097166; 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=RdRBEoYxRIkuYEuDHr3V4GvXlKW2Lf5ylOPLl+U6EFw=; b=JeERaHUwD4cdloIb60iZKQcRP/DhF9rYJAvhT0MYmN7hOip+6OSmzh4vVUNkX0jI7s3o2P noGp2YMr4kcl2bJxTyO7CdeoY7KjqcLni85/KVIyeHpMwDvArgpJUFAqdWMjcIDCM57t3x Sndyo50ztMJ4Eeoju3zKDs86XPIkd9A= 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-345-kBsvBemiNpC3wBla7JKNyw-1; Wed, 11 Dec 2019 15:46:03 -0500 X-MC-Unique: kBsvBemiNpC3wBla7JKNyw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BC1C1883534; Wed, 11 Dec 2019 20:46:02 +0000 (UTC) Received: from ovpn-116-192.phx2.redhat.com (ovpn-116-192.phx2.redhat.com [10.3.116.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A1DA60BB1; Wed, 11 Dec 2019 20:46:01 +0000 (UTC) Message-ID: <9a4db39373cf4acaf91ef6db92df116b74fef992.camel@redhat.com> Subject: Re: [PATCH] timers/nohz: Update nohz load even if tick already stopped From: Scott Wood To: Peter Zijlstra Cc: Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , LKML Date: Wed, 11 Dec 2019 14:46:01 -0600 In-Reply-To: <20191030133130.GY4097@hirez.programming.kicks-ass.net> References: <20191028150716.22890-1-frederic@kernel.org> <20191029100506.GJ4114@hirez.programming.kicks-ass.net> <52d963553deda810113accd8d69b6dffdb37144f.camel@redhat.com> <20191030133130.GY4097@hirez.programming.kicks-ass.net> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-10-30 at 14:31 +0100, Peter Zijlstra wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index eb42b71faab9..d02d1b8f40af 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3660,21 +3660,17 @@ static void sched_tick_remote(struct work_struct > *work) > u64 delta; > int os; > > - /* > - * Handle the tick only if it appears the remote CPU is running in > full > - * dynticks mode. The check is racy by nature, but missing a tick or > - * having one too much is no big deal because the scheduler tick > updates > - * statistics and checks timeslices in a time-independent way, > regardless > - * of when exactly it is running. > - */ > - if (idle_cpu(cpu) || !tick_nohz_tick_stopped_cpu(cpu)) > + if (!tick_nohz_tick_stopped_cpu(cpu)) > goto out_requeue; > > rq_lock_irq(rq, &rf); > - curr = rq->curr; > - if (is_idle_task(curr) || cpu_is_offline(cpu)) > + /* > + * We must not call calc_load_nohz_remote() when not in NOHZ mode. > + */ > + if (cpu_is_offline(cpu) || !tick_nohz_tick_stopped(cpu)) > goto out_unlock; Is it really a problem if calc_load_nohz_remote() gets called in non-NOHZ? It won't race due to rq lock -- and we're already mixing remote and non-remote updates because the normal tick timer can still be run while "stopped". -Scott