linux hrtimer affinity

Peter Teoh htmldeveloper at gmail.com
Sun Feb 19 21:09:29 EST 2012


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 at gmail.com> wrote:

>
>
> On Wed, Feb 15, 2012 at 12:06 AM, Vimal <j.vimal at 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 


More information about the Kernelnewbies mailing list