From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093AbdI1IPO (ORCPT ); Thu, 28 Sep 2017 04:15:14 -0400 Received: from merlin.infradead.org ([205.233.59.134]:50356 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751873AbdI1IPN (ORCPT ); Thu, 28 Sep 2017 04:15:13 -0400 Date: Thu, 28 Sep 2017 10:15:01 +0200 From: Peter Zijlstra To: Thomas Gleixner 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 Message-ID: <20170928081501.pmleqw3gr6cftgrx@hirez.programming.kicks-ass.net> References: <20170831105725.809317030@linutronix.de> <20170831105826.921969670@linutronix.de> <20170927164025.GI17526@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Sep 28, 2017 at 09:59:50AM +0200, Thomas Gleixner wrote: > 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. True, I wasn't entirely sure on the irq tracing assumptions (if any) and was too lazy to double check.