From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752493AbdI0QrB (ORCPT ); Wed, 27 Sep 2017 12:47:01 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44534 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbdI0Qq7 (ORCPT ); Wed, 27 Sep 2017 12:46:59 -0400 Date: Wed, 27 Sep 2017 18:46:50 +0200 From: Peter Zijlstra To: Anna-Maria Gleixner Cc: 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: <20170927164650.GJ17526@worktop.programming.kicks-ass.net> References: <20170831105725.809317030@linutronix.de> <20170831105826.921969670@linutronix.de> <20170926150311.ksxokdvvyqu36sud@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 27, 2017 at 04:22:39PM +0200, Anna-Maria Gleixner wrote: > I know and Thomas was unhappy about that as well, but we did not come > up with a better solution. > > The nasty alternative is: > > static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, > struct hrtimer_clock_base *base, > - struct hrtimer *timer, ktime_t *now) > + struct hrtimer *timer, ktime_t *now, > + unsigned long flags) > ... > - raw_spin_unlock(&cpu_base->lock); > + raw_spin_unlock_irqrestore(&cpu_base->lock, flags); > > ... > - raw_spin_lock(&cpu_base->lock); > + raw_spin_lock_irq(&cpu_base->lock, flags); > > and hand in flags from the callsites via local_save_flags(). Just push it up one more level and use raw_spin_lock_irqsave() in the (soft)irq handlers and then pass the flags around. Thta's what I did in that patch I just send.