From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:52412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbdLYQY1 (ORCPT ); Mon, 25 Dec 2017 11:24:27 -0500 Date: Mon, 25 Dec 2017 17:24:21 +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, rt@linutronix.de Subject: Re: [patch 1/4] timer: Use deferrable base independent of base::nohz_active Message-ID: <20171225162418.GA25931@lerouge> References: <20171222145111.919609918@linutronix.de> <20171222145337.633328378@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171222145337.633328378@linutronix.de> Sender: stable-owner@vger.kernel.org List-ID: On Fri, Dec 22, 2017 at 03:51:12PM +0100, Thomas Gleixner wrote: > From: Anna-Maria Gleixner > > During boot and before base::nohz_active is set in the timer bases, deferrable > timers are enqueued into the standard timer base. This works correctly as > long as base::nohz_active is false. > > Once it base::nohz_active is set and a timer which was enqueued before that > is accessed the lock selector code choses the lock of the deferred > base. This causes unlocked access to the standard base and in case the > timer is removed it does not clear the pending flag in the standard base > bitmap which causes get_next_timer_interrupt() to return bogus values. > > To prevent that, the deferrable timers must be enqueued in the deferrable > base, even when base::nohz_active is not set. Those deferrable timers also > need to be expired unconditional. > > Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel") > Signed-off-by: Anna-Maria Gleixner > Signed-off-by: Thomas Gleixner > Cc: stable@vger.kernel.org > Cc: rt@linutronix.de Nice catch! Reviewed-by: Frederic Weisbecker Thanks!