* linux hrtimer affinity
@ 2012-02-14 16:06 Vimal
2012-02-19 23:50 ` Peter Teoh
0 siblings, 1 reply; 4+ messages in thread
From: Vimal @ 2012-02-14 16:06 UTC (permalink / raw)
To: kernelnewbies
Hi all,
Is there a way to set the affinity of hrtimer callback, so that it
executes on a particular logical CPU?
The reason is that I have a hrtimer callback that executes a tasklet.
If the timer callback executes on a different CPU than the one it was
enqueued in, then the tasklet is scheduled on the same CPU, which
makes it difficult to reason serialising locks to per-CPU data
structures.
Any ideas?
Thanks,
--
Vimal
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux hrtimer affinity
[not found] <mailman.1.1329498001.1915.kernelnewbies@kernelnewbies.org>
@ 2012-02-18 18:04 ` Vikram Narayanan
0 siblings, 0 replies; 4+ messages in thread
From: Vikram Narayanan @ 2012-02-18 18:04 UTC (permalink / raw)
To: kernelnewbies
Hello,
On 17-Feb-12 00:58:30, srimugunthan dhandapani wrote:
> Hi all
> As an experiment, i am trying to use softirq instead of using tasklet
> in my driver code.
Softirqs are meant for very critical processing. Why don't you reconsider?
> I was passing the driver's structure pointer to the tasklet.
Tasklet or softirq?
> The "open_softirq" takes only the function pointer as argument.
> Since we can't pass any argument to the softirq, is there any
> workaround that is possible to make the structure pointer accessible
> to softirq?
Anyways, you would've defined the softirq handler in your driver. right?
> I just need to do this for taking measurements.
Timestamps?
HTH,
Vikram
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux hrtimer affinity
2012-02-14 16:06 Vimal
@ 2012-02-19 23:50 ` Peter Teoh
2012-02-20 2:09 ` Peter Teoh
0 siblings, 1 reply; 4+ messages in thread
From: Peter Teoh @ 2012-02-19 23:50 UTC (permalink / raw)
To: kernelnewbies
On Wed, Feb 15, 2012 at 12:06 AM, Vimal <j.vimal@gmail.com> wrote:
> Hi all,
>
> Is there a way to set the affinity of hrtimer callback, so that it
> executes on a particular logical CPU?
>
> The reason is that I have a hrtimer callback that executes a tasklet.
If the timer callback executes on a different CPU than the one it was
> enqueued in, then the tasklet is scheduled on the same CPU, which
> makes it difficult to reason serialising locks to per-CPU data
>
How about this:
http://www.makelinux.net/ldd3/chp-7-sect-5
Tasklet is executed and scheduled on a particular known cpu, so unless u
spawn another tasklet that execute on the other CPU, u don't need per-CPU
data structure - simply because there is no another CPU to contend with the
data structure. Not sure if I got the point?
I am not sure why u need to synchronize stuff "between CPU", as a
particular tasklet is only executed on only one CPU at a time:
I suspect what u wanted is a "task". A tasklet is effectively a "bottom
half" and u are holding a spinlock while executing it, and thus it really
has to be very fast. Read this paper:
http://www.wil.cx/matthew/lca2003/paper.pdf
structures.
>
> Any ideas?
>
> Thanks,
> --
> Vimal
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120220/ece3ad71/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* linux hrtimer affinity
2012-02-19 23:50 ` Peter Teoh
@ 2012-02-20 2:09 ` Peter Teoh
0 siblings, 0 replies; 4+ messages in thread
From: Peter Teoh @ 2012-02-20 2:09 UTC (permalink / raw)
To: kernelnewbies
Read this:
http://lwn.net/Articles/296578/
Take note there are several apis available:
schedule_hrtimeout, schedule_hrtimeout_range, schedule_timeout,
schedule_timeout_range, schedule_timeout_uninterruptible etc.
On Mon, Feb 20, 2012 at 7:50 AM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>
>
> On Wed, Feb 15, 2012 at 12:06 AM, Vimal <j.vimal@gmail.com> wrote:
>
>> Hi all,
>>
>> Is there a way to set the affinity of hrtimer callback, so that it
>> executes on a particular logical CPU?
>>
>
>> The reason is that I have a hrtimer callback that executes a tasklet.
>
> If the timer callback executes on a different CPU than the one it was
>> enqueued in, then the tasklet is scheduled on the same CPU, which
>> makes it difficult to reason serialising locks to per-CPU data
>>
>
> How about this:
>
> http://www.makelinux.net/ldd3/chp-7-sect-5
>
> Tasklet is executed and scheduled on a particular known cpu, so unless u
> spawn another tasklet that execute on the other CPU, u don't need per-CPU
> data structure - simply because there is no another CPU to contend with the
> data structure. Not sure if I got the point?
>
> I am not sure why u need to synchronize stuff "between CPU", as a
> particular tasklet is only executed on only one CPU at a time:
>
> I suspect what u wanted is a "task". A tasklet is effectively a "bottom
> half" and u are holding a spinlock while executing it, and thus it really
> has to be very fast. Read this paper:
>
> http://www.wil.cx/matthew/lca2003/paper.pdf
>
>
> structures.
>>
>> Any ideas?
>>
>> Thanks,
>> --
>> Vimal
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>
>
>
> --
> Regards,
> Peter Teoh
>
--
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120220/eb0b31d7/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-20 2:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.1.1329498001.1915.kernelnewbies@kernelnewbies.org>
2012-02-18 18:04 ` linux hrtimer affinity Vikram Narayanan
2012-02-14 16:06 Vimal
2012-02-19 23:50 ` Peter Teoh
2012-02-20 2:09 ` Peter Teoh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).