From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966285AbdLSNVa (ORCPT ); Tue, 19 Dec 2017 08:21:30 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:48676 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965422AbdLSNV2 (ORCPT ); Tue, 19 Dec 2017 08:21:28 -0500 Date: Tue, 19 Dec 2017 14:21:23 +0100 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: Anna-Maria Gleixner , LKML , Ingo Molnar , Christoph Hellwig , keescook@chromium.org, John Stultz , Thomas Gleixner Subject: Re: [PATCH 17/25] hrtimer: Implementation of softirq hrtimer handling Message-ID: <20171219132123.ut4vrmd5uigz4bw7@hirez.programming.kicks-ass.net> References: <20170831105725.809317030@linutronix.de> <20170831105826.921969670@linutronix.de> <20170927164025.GI17526@worktop.programming.kicks-ass.net> <20171219085843.l55fasrfdqdyta5z@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171219085843.l55fasrfdqdyta5z@breakpoint.cc> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 19, 2017 at 09:58:44AM +0100, Sebastian Andrzej Siewior wrote: > this is late I know… > > On 2017-09-27 18:40:26 [+0200], Peter Zijlstra wrote: > > - removed superfluous local_bh_disable(), since local_irq_disable() > > already implies much the same. > > it is not superfluous. > > > Please consider... > > > > @@ -1768,7 +1786,6 @@ int hrtimers_dead_cpu(unsigned int scpu) > > BUG_ON(cpu_online(scpu)); > > tick_cancel_sched_timer(scpu); > > > > - local_bh_disable(); > > local_irq_disable(); > > old_base = &per_cpu(hrtimer_bases, scpu); > > new_base = this_cpu_ptr(&hrtimer_bases); > > @@ -1796,7 +1813,6 @@ int hrtimers_dead_cpu(unsigned int scpu) > > /* Check, if we got expired work to do */ > > __hrtimer_peek_ahead_timers(); > > local_irq_enable(); > > - local_bh_enable(); > > return 0; > > } > > we need in there. That local_bh_disable() is required in order to let > raise_softirq_irqoff() not do anything stupid in particular we need > !in_interrupt() defer wakeup_softirqd() until local_bh_enable(). > Otherwise wakeup_softirqd() might actually try to wakeup the process and > go after the pi_lock which can't happen while holding cpu_base->lock. Argh, that's horrible and definitely needs a comment.