From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933605AbcFMOgz (ORCPT ); Mon, 13 Jun 2016 10:36:55 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36832 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933449AbcFMOgx (ORCPT ); Mon, 13 Jun 2016 10:36:53 -0400 Date: Mon, 13 Jun 2016 16:36:48 +0200 From: Richard Cochran To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Eric Dumazet , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de Subject: Re: [patch 13/20] timer: Switch to a non cascading wheel Message-ID: <20160613143647.GA17907@localhost.localdomain> References: <20160613070440.950649741@linutronix.de> <20160613075929.282143900@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160613075929.282143900@linutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2016 at 08:41:00AM -0000, Thomas Gleixner wrote: > +static inline struct timer_base *get_timer_base(u32 tflags) > +{ > + return get_timer_cpu_base(tflags, tflags & TIMER_BASEMASK); > +} This should rather be (tflags & TIMER_CPUMASK) to avoid using per_cpu_ptr() with the TIMER_MIGRATING bit set in the CPU index. The one caller in this patch is okay, since it already checks that TIMER_MIGRATING is clear: > static struct timer_base *lock_timer_base(struct timer_list *timer, > - unsigned long *flags) > + unsigned long *flags) > __acquires(timer->base->lock) > { > for (;;) { > - u32 tf = timer->flags; > struct timer_base *base; > + u32 tf = timer->flags; > > if (!(tf & TIMER_MIGRATING)) { > - base = per_cpu_ptr(&timer_bases, tf & TIMER_CPUMASK); > + base = get_timer_base(tf); However, in patch #20, we'll have this in __mod_timer(); /* * Take the current timer_jiffies of base, but without holding * the lock! */ base = get_timer_base(timer->flags); Thanks, Richard