From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: arun@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org,
linux-pm@lists.linux-foundation.org, ego@in.ibm.com,
tglx@linutronix.de, mingo@elte.hu, andi@firstfloor.org,
venkatesh.pallipadi@intel.com, vatsa@linux.vnet.ibm.com,
arjan@infradead.org
Subject: Re: [RFC PATCH 2/4] timers: new framework for identifying cpu-pinned timers
Date: Thu, 16 Oct 2008 13:53:02 +0200 [thread overview]
Message-ID: <1224157982.28131.49.camel@twins> (raw)
In-Reply-To: <20081016114830.GC7641@linux.vnet.ibm.com>
On Thu, 2008-10-16 at 17:18 +0530, Arun R Bharadwaj wrote:
> This patch creates the necessary framework for identifying cpu-pinned
> regular timers and hrtimers.
>
> For regular timers a new flag called TBASE_PINNED_FLAG is created.
> Since the last 3 bits of the tvec_base is guaranteed to be 0, and
> since the last bit is being used to indicate deferrable timers, I'm
> using the second last bit to indicate cpu-pinned regular timers.
> The implementation of functions to manage the TBASE_PINNED_FLAG is
> similar to those which manage the TBASE_DEFERRABLE_FLAG.
>
> For hrtimers, there is no clear interface to queue a hrtimer as a
> per-cpu hrtimer. But there are instances where, if an hrtimer is queued
> on a particular cpu, it expects to run on the same cpu.
> The hrtimer hrtick_timer is one such example.
>
> So, in this regard, I've created a new interface called
> hrtimer_start_pinned which can be used to queue cpu-pinned hrtimer.
> In the hrtimer structure, there is a variable called *state* which
> is used to indicate the state of a hrtimer - inactive, enqueued,
> callback function running and callback pending. Currently, since only
> 5 bits are being used in the state variable, I've used the 6th bit
> to represent the cpu-pinned state of the hrtimer
>
>
> Signed-off-by: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Thomas recently created HRTIMER_CB_IRQSAFE_PERCPU which serves this
purpose to close some cpu-hotplug timer races.
> @@ -97,6 +96,7 @@ enum hrtimer_cb_mode {
> #define HRTIMER_STATE_CALLBACK 0x02
> #define HRTIMER_STATE_PENDING 0x04
> #define HRTIMER_STATE_MIGRATE 0x08
> +#define HRTIMER_CPU_PINNED 0X16
Hehe, may I suggest 0x10 :-)
next prev parent reply other threads:[~2008-10-16 11:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 11:48 [RFC PATCH 2/4] timers: new framework for identifying cpu-pinned timers Arun R Bharadwaj
2008-10-16 11:53 ` Peter Zijlstra [this message]
2008-10-16 14:03 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1224157982.28131.49.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=arjan@infradead.org \
--cc=arun@linux.vnet.ibm.com \
--cc=ego@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vatsa@linux.vnet.ibm.com \
--cc=venkatesh.pallipadi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox