Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2913293imm; Fri, 24 Aug 2018 07:29:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ4gfbr/H9VnpmNyAM7Kg71ELaXaccHqVApdARp5gO/0jdiCBSakV6STqOTq6mslczm5PJM X-Received: by 2002:a63:a402:: with SMTP id c2-v6mr1999828pgf.180.1535120949483; Fri, 24 Aug 2018 07:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535120949; cv=none; d=google.com; s=arc-20160816; b=TBAw3aVP15qeG/0lBK6PIlOf0n6l3oQZZMQuR0J9WGRfdSDfgjQJ9h6pYB2/P8j7dA 9c/mrBG0bBFTKuGLoolR835nHloJgu2eD4VErchcxnASMHlhCOe1KdkV+ko+nHgs0Qv8 Ul5GsOjhQ2ZEImKFLbDHY9L5kYeZ3InWvwsbEJh7rRLz4XGk4hVHBEk5H1YyfaHtiOV2 69gRdrcZfPSFZRpzPfHD3mw9Mm9ADAFxVSUfhAwWoAMDEfzOmIYGgl0t7U7yU1JpFloK neYRNxlwdYa9woB06NrdrDGVH3yVOYQQD+edZOEt2tXqdA+dcgBWLkjcfA9OfPipCjgY tjkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=l6SeaZgJWJ9YUikA+vaL3wkNcA4l9CBaKxCj8TSs8Rk=; b=JYNJQyB6MzyvZmPnhBSjccbzM3ZtYv+WhkScH+eONAQ69H0cgG4UyBPy93N/lA1INy ZV4u2Vgnt6g6Fj7hYVNp0PWm/RiJzhl72zxMLlenshL/DoG+xzCxF7j2QDYFAGyg5q16 Bl9HQjcmcZljo4jiQ87u761vWqOUnWn/jypG55tYjtjCHJ7obBz8z7m4mhg2evtJ1LNr psHgI5u/tacWDQ39xNEe8x1KAYNjPyYHujqtoA1jrEY+XKm8zx4CF+4PVehVIS9E3haC fnhQwa1dJ59kZxV1d8QVjU8/yfq7FKD1hM/1/21MCtcyCLIeCZAVcarf0HJXKGGukBK9 0YXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a1yWt30O; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6-v6si6294829plp.279.2018.08.24.07.28.53; Fri, 24 Aug 2018 07:29:09 -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=@kernel.org header.s=default header.b=a1yWt30O; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeHXSCL (ORCPT + 99 others); Fri, 24 Aug 2018 14:02:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbeHXSCL (ORCPT ); Fri, 24 Aug 2018 14:02:11 -0400 Received: from localhost (LFbn-NCY-1-241-207.w83-194.abo.wanadoo.fr [83.194.85.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D39B208CB; Fri, 24 Aug 2018 14:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535120837; bh=aavINfquTo50rgO/Rmdx/0lbTyr2PL7JRu363bKElw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a1yWt30OdAK+pF45C5tRhNAPX+gbjyscbUX0uRyn9abVYSjnxpcLSJYi2celpPaq1 wVC2yUrAIKCGcT/FOwjYYYWM4liGdEDpMEDwefk91MBxFlPxacJQCGZ3Rq48/mgGFo zBm3394NJfLcf/tggnWKYS0RcJlMGvqrYOul9OS0= Date: Fri, 24 Aug 2018 16:27:15 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: Greg KH , Grygorii Strashko , LKML , Ingo Molnar , Anna-Maria Gleixner , stable@vger.kernel.org Subject: Re: [PATCH] nohz: Fix missing tick reprog while interrupting inline timer softirq Message-ID: <20180824142713.GB2730@lerouge> References: <1533077570-9169-1-git-send-email-frederic@kernel.org> <8ecb9229-4c14-6967-0863-15b47cefd251@ti.com> <20180824061750.GA20523@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 24, 2018 at 09:01:02AM +0200, Thomas Gleixner wrote: > On Fri, 24 Aug 2018, Greg KH wrote: > > On Thu, Aug 23, 2018 at 05:57:06PM -0500, Grygorii Strashko wrote: > > > This patch was back ported to the Stable linux-4.14.y and It causes regression - > > > flood of "NOHZ: local_softirq_pending" messages on all TI boards during boot (NFS boot): > > > > > > [ 4.179796] NOHZ: local_softirq_pending 2c2 in sirq 256 > > > [ 4.185051] NOHZ: local_softirq_pending 2c2 in sirq 256 > > This printout is weird. Did you add something here? > > > > the same is not reproducible with LKML - seems due to changes in tick-sched.c > > > __tick_nohz_idle_enter()/tick_nohz_irq_exit(). > > > > What changes do you think fixed this? > > > > > I've generated backtrace from can_stop_idle_tick() (see below) and seems this > > > patch makes tick_nohz_irq_exit() call unconditional in case of nested interrupt: > > > > > > gic_handle_irq > > > |- irq_exit > > > |- preempt_count_sub(HARDIRQ_OFFSET); <-- [1] > > > |-__do_softirq > > > > > > |- gic_handle_irq() > > > |- irq_exit() > > > |- tick_irq_exit() > > > if (!in_irq()) <-- My understanding is that this condition will be always true due to [1] > > Correct, but that's not the problem. The issue is that this happens in a > softirq disabled region. Does the below fix it? > > Thanks, > > tglx > > 8<-------------------- > diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c > index 5b33e2f5c0ed..6aab9d54a331 100644 > --- a/kernel/time/tick-sched.c > +++ b/kernel/time/tick-sched.c > @@ -888,7 +888,7 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) > if (unlikely(local_softirq_pending() && cpu_online(cpu))) { > static int ratelimit; > > - if (ratelimit < 10 && > + if (ratelimit < 10 && !in_softirq() && > (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { > pr_warn("NOHZ: local_softirq_pending %02x\n", > (unsigned int) local_softirq_pending()); > > Good catch! In 4.14 Rafael hadn't yet changed the path where we stop the idle tick. We were still stopping it from irq exit and so we could do that while interrupting a softirq. So we may need to backport this along with "nohz: Fix missing tick reprogram when interrupting an inline softirq".