<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 15, 2016 at 10:47 AM, Vishwas Srivastava <span dir="ltr"><<a href="mailto:vishu.kernel@gmail.com" target="_blank">vishu.kernel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote">
On Sun, Feb 14, 2016 at 9:16 AM, tobaccopipeyoyo . <<br>
<a href="mailto:tobaccopipeyoyo@gmail.com" target="_blank">tobaccopipeyoyo@gmail.com</a>> wrote:<br>
<br>
> 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>
><br>
Hi...<br>
<br>
during interrupt servicing, "current" will give you last process' data<br>
structure that's get interrupted by the interrupt. Of course, this is per<br>
cpu context, so if you are in SMP situation, current will return task<br>
struct in that CPU only.<br>
<br>
The essential thing in interrupt servicing is: interrupt handler runs on<br>
behalf of current running process.<br>
<br>
Hopefully I still recall all these correctly.<br>
<br>
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br><br></div><div class="gmail_quote">Hi Mulyadi,<br></div><div class="gmail_quote"> I disagree with the statement you made here that "interrupt handler runs on behalf of current running process".<br></div><div class="gmail_quote">Your statement is valid for system calls (software interrupt) but not for the real "interrupt"<br></div><div class="gmail_quote">Interrupt handler are nowhere related to any process. They run their own without caring about<br></div><div class="gmail_quote">which process was running.<br></div><div class="gmail_quote">--- Vishwas<br></div><br></div><br></blockquote></div><br></div><div class="gmail_extra">Hello Vishwas<br><br></div><div class="gmail_extra">Thank you for your correction.<br><br></div><div class="gmail_extra">You're correct. Maybe my wording is not exactly correct. My intention was to point that especially during bottom half interrupt servicing, if you run call "current", it will point to last process before kernel switch to kernel mode servicing the interrupt. So the word "on behalf" is not exactly correct, I admit that.<br><br></div><div class="gmail_extra">Feel free to correct if I am still wrong...<br><br></div><div class="gmail_extra"><br clear="all"><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>