From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbcGANDn (ORCPT ); Fri, 1 Jul 2016 09:03:43 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35112 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751426AbcGANDi (ORCPT ); Fri, 1 Jul 2016 09:03:38 -0400 Date: Fri, 1 Jul 2016 15:03:29 +0200 From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Eric Dumazet , Chris Mason , Arjan van de Ven , rt@linutronix.de, Rik van Riel , Linus Torvalds , George Spelvin , Len Brown , Josh Triplett Subject: Re: [patch V3 01/22] timer: Make pinned a timer property Message-ID: <20160701130327.GA2582@lerouge> References: <20160624140325.554996200@linutronix.de> <20160624141721.493309876@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160624141721.493309876@linutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 24, 2016 at 02:32:01PM -0000, Thomas Gleixner wrote: > We want to move the timer migration from a push to a pull model. This requires > to store the pinned attribute of a timer in the timer itself. This must happen > at initialization time. > > Add the helper macros for this. > > Signed-off-by: Thomas Gleixner > Cc: Peter Zijlstra > Cc: Frederic Weisbecker > Cc: Chris Mason > Cc: Eric Dumazet > Cc: rt@linutronix.de > Cc: "Paul E. McKenney" > Cc: Arjan van de Ven > > > --- > include/linux/timer.h | 25 ++++++++++++++++++++++--- > kernel/time/timer.c | 10 +++++----- > 2 files changed, 27 insertions(+), 8 deletions(-) > > --- a/include/linux/timer.h > +++ b/include/linux/timer.h > @@ -62,7 +62,8 @@ struct timer_list { > #define TIMER_MIGRATING 0x00080000 > #define TIMER_BASEMASK (TIMER_CPUMASK | TIMER_MIGRATING) > #define TIMER_DEFERRABLE 0x00100000 > -#define TIMER_IRQSAFE 0x00200000 > +#define TIMER_PINNED 0x00200000 > +#define TIMER_IRQSAFE 0x00400000 > > #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \ > .entry = { .next = TIMER_ENTRY_STATIC }, \ > @@ -78,9 +79,15 @@ struct timer_list { > #define TIMER_INITIALIZER(_function, _expires, _data) \ > __TIMER_INITIALIZER((_function), (_expires), (_data), 0) > > +#define TIMER_PINNED_INITIALIZER(_function, _expires, _data) \ > + __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_PINNED) > + > #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data) \ > __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE) > > +#define TIMER_PINNED_DEFERRED_INITIALIZER(_function, _expires, _data) \ > + __TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE | TIMER_PINNED) > + I guess it means that no timer took the freedom to be sometimes enqueued pinned and sometimes unpinned. Which is a good news :-)