From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751083AbdLZPRx (ORCPT ); Tue, 26 Dec 2017 10:17:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:50504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750740AbdLZPRw (ORCPT ); Tue, 26 Dec 2017 10:17:52 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D996E21891 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=frederic@kernel.org Date: Tue, 26 Dec 2017 16:17:48 +0100 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Anna-Maria Gleixner , Sebastian Siewior , Paul McKenney , Peter Zijlstra , Frederic Weisbecker , Ingo Molnar , stable@vger.kernel.org Subject: Re: [patch 2/4] nohz: Prevent erroneous tick stop invocations Message-ID: <20171226151746.GA6560@lerouge> References: <20171222145111.919609918@linutronix.de> <20171222145337.713295508@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171222145337.713295508@linutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 22, 2017 at 03:51:13PM +0100, Thomas Gleixner wrote: > The conditions in irq_exit() to invoke tick_nohz_irq_exit() are: > > if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) > > This is too permissive in various aspects: > > 1) If need_resched() is set, then the tick cannot be stopped whether > the CPU is idle or in nohz full mode. That's not exactly true. In nohz full mode the tick is not restarted on the switch from idle to a single task. And if an idle interrupt wakes up a single task and enqueues a timer, we want that timer to be programmed even though we have need_resched().