From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbdI1IAA (ORCPT ); Thu, 28 Sep 2017 04:00:00 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:55278 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751827AbdI1H77 (ORCPT ); Thu, 28 Sep 2017 03:59:59 -0400 Date: Thu, 28 Sep 2017 09:59:50 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Anna-Maria Gleixner , LKML , Ingo Molnar , Christoph Hellwig , keescook@chromium.org, John Stultz Subject: Re: [PATCH 17/25] hrtimer: Implementation of softirq hrtimer handling In-Reply-To: <20170927164025.GI17526@worktop.programming.kicks-ass.net> Message-ID: References: <20170831105725.809317030@linutronix.de> <20170831105826.921969670@linutronix.de> <20170927164025.GI17526@worktop.programming.kicks-ass.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 Sep 2017, Peter Zijlstra wrote: > On Thu, Aug 31, 2017 at 12:23:42PM -0000, Anna-Maria Gleixner wrote: > static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, > struct hrtimer_clock_base *base, > struct hrtimer *timer, ktime_t *now, > - bool hardirq) > + unsigned long flags) > { > enum hrtimer_restart (*fn)(struct hrtimer *); > int restart; > @@ -1298,19 +1323,13 @@ static void __run_hrtimer(struct hrtimer > * protected against migration to a different CPU even if the lock > * is dropped. > */ > - if (hardirq) > - raw_spin_unlock(&cpu_base->lock); > - else > - raw_spin_unlock_irq(&cpu_base->lock); > + raw_spin_unlock_irqrestore(&cpu_base->lock, flags); > > trace_hrtimer_expire_entry(timer, now); > restart = fn(timer); > trace_hrtimer_expire_exit(timer); > > - if (hardirq) > - raw_spin_lock(&cpu_base->lock); > - else > - raw_spin_lock_irq(&cpu_base->lock); > + raw_spin_lock_irqsave(&cpu_base->lock, flags); No point in irqsave() here. _irq() is sufficient as we leave the function right after that. Thanks, tglx