Re: Kernelnewbies Digest, Vol 63, Issue 20
---------- Forwarded message ---------- From: <kernelnewbies-request@kernelnewbies.org> Date: Mon, Feb 15, 2016 at 5:40 AM Subject: Kernelnewbies Digest, Vol 63, Issue 20 To: kernelnewbies@kernelnewbies.org Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-request@kernelnewbies.org You can reach the person managing the list at kernelnewbies-owner@kernelnewbies.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..." Today's Topics: 1. Re: current during interrupt servicing (Mulyadi Santosa) 2. Merge conflict (YU Bo) 3. Re: Merge conflict (Roger H Newell) 4. Re:Re: Merge conflict (YU Bo) ---------------------------------------------------------------------- Message: 1 Date: Mon, 15 Feb 2016 01:10:53 +0700 From: Mulyadi Santosa <mulyadi.santosa@gmail.com> Subject: Re: current during interrupt servicing To: "tobaccopipeyoyo ." <tobaccopipeyoyo@gmail.com> Cc: kernelnewbies <kernelnewbies@kernelnewbies.org> Message-ID: <CAGdaadYgnA7JwfgUCxa=hiJjQm4Oz+rDy-htZCi6cdw7O8WFgg@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Sun, Feb 14, 2016 at 9:16 AM, tobaccopipeyoyo . < tobaccopipeyoyo@gmail.com> wrote:
Hi, I'm new to kernel programming, currently started ldd book For the current process it says that global item current returns the task_struct of the currently running process.
What if I refer this global during interrupt servicing? What will happen? What should I expect.
Thanks, tpyy
Hi... 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. The essential thing in interrupt servicing is: interrupt handler runs on behalf of current running process. Hopefully I still recall all these correctly. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant Hi Mulyadi, I disagree with the statement you made here that "interrupt handler runs on behalf of current running process". Your statement is valid for system calls (software interrupt) but not for the real "interrupt" Interrupt handler are nowhere related to any process. They run their own without caring about which process was running. --- Vishwas blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Mon, Feb 15, 2016 at 10:47 AM, Vishwas Srivastava <vishu.kernel@gmail.com
wrote:
On Sun, Feb 14, 2016 at 9:16 AM, tobaccopipeyoyo . < tobaccopipeyoyo@gmail.com> wrote:
Hi, I'm new to kernel programming, currently started ldd book For the current process it says that global item current returns the task_struct of the currently running process.
What if I refer this global during interrupt servicing? What will happen? What should I expect.
Thanks, tpyy
Hi...
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.
The essential thing in interrupt servicing is: interrupt handler runs on behalf of current running process.
Hopefully I still recall all these correctly.
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
Hi Mulyadi, I disagree with the statement you made here that "interrupt handler runs on behalf of current running process". Your statement is valid for system calls (software interrupt) but not for the real "interrupt" Interrupt handler are nowhere related to any process. They run their own without caring about which process was running. --- Vishwas
Hello Vishwas Thank you for your correction. 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. Feel free to correct if I am still wrong... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (2)
-
Mulyadi Santosa -
Vishwas Srivastava