[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160613143647.GA17907@localhost.localdomain>
Date: Mon, 13 Jun 2016 16:36:48 +0200
From: Richard Cochran <richardcochran@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Eric Dumazet <edumazet@...gle.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Chris Mason <clm@...com>,
Arjan van de Ven <arjan@...radead.org>, rt@...utronix.de
Subject: Re: [patch 13/20] timer: Switch to a non cascading wheel
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
Powered by blists - more mailing lists