<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 14, 2016 at 9:16 AM, tobaccopipeyoyo . <span dir="ltr"><<a href="mailto:tobaccopipeyoyo@gmail.com" target="_blank">tobaccopipeyoyo@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,<br>
I'm new to kernel programming, currently started ldd book<br>
For the current process it says that global item current returns the<br>
task_struct of the currently running process.<br>
<br>
What if I refer this global during interrupt servicing?<br>
What will happen? What should I expect.<br>
<br>
Thanks,<br>
tpyy<br>
<br></blockquote></div><br></div><div class="gmail_extra">Hi...<br><br></div><div class="gmail_extra">during interrupt servicing, "current" will give you last process' data structure that's get interrupted by the interrupt. Of course, this is per cpu context, so if you are in SMP situation, current will return task struct in that CPU only.<br><br></div><div class="gmail_extra">The essential thing in interrupt servicing is: interrupt handler runs on behalf of current running process.<br><br></div><div class="gmail_extra">Hopefully I still recall all these correctly.<br></div><div class="gmail_extra"><br><br>-- <br><div class="gmail_signature">regards,<br><br>Mulyadi Santosa<br>Freelance Linux trainer and consultant<br><br>blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a></div>
</div></div>