<br><br><div class="gmail_quote">On Wed, Feb 15, 2012 at 12:06 AM, Vimal <span dir="ltr"><<a href="mailto:j.vimal@gmail.com" target="_blank">j.vimal@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
Is there a way to set the affinity of hrtimer callback, so that it<br>
executes on a particular logical CPU?<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
The reason is that I have a hrtimer callback that executes a tasklet.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If the timer callback executes on a different CPU than the one it was<br>
enqueued in, then the tasklet is scheduled on the same CPU, which<br>
makes it difficult to reason serialising locks to per-CPU data<br></blockquote><div><br></div><div>How about this:</div><div><br></div><div><a href="http://www.makelinux.net/ldd3/chp-7-sect-5" target="_blank">http://www.makelinux.net/ldd3/chp-7-sect-5</a></div>
<div><br></div><div>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?</div>
<div><br></div><div>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:</div><div><br></div><div>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:</div>
<div><br></div><div><div><a href="http://www.wil.cx/matthew/lca2003/paper.pdf">http://www.wil.cx/matthew/lca2003/paper.pdf</a></div><div><br></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
structures.<br>
<br>
Any ideas?<br>
<br>
Thanks,<br>
<font color="#888888">--<br>
Vimal<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh<br>