<div dir="ltr">AFAIK, those three contexts that you mentioned are indeed the only contexts that an 'instruction' can be in. If you look at the top-voted answer on the stackoverflow question that you cited, it explains how a kernel thread executes kernel instructions in a process context. The idea of a 'thread' in Linux is very similar to that of a process. In fact, every 'thread' _is_ a process. Just that a 'thread'/'process' happens to share some resources with other threads/process (ex. stack, text section etc.). <div>
<br></div><div>A kernel thread in addition has _no_ user-space addresses. The 'mm' pointer (which points to the user-space addresses of a process) is set to NULL for kernel threads. That is okay, because kernel threads are _not_ supposed to execute/access anything that might belong to a process/lies in user-space.</div>
<div> </div><div>For details, refer Linux Kernel Dev. by Robert Love.</div><div><br></div><div>~Gaurav <br><br><div class="gmail_quote">On Mon, Oct 8, 2012 at 12:42 PM, Robert P. J. Day <span dir="ltr"><<a href="mailto:rpjday@crashcourse.ca" target="_blank">rpjday@crashcourse.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
the standard explanation of context related to linux is that there<br>
are three "contexts" one can be in at any time:<br>
<br>
* user context<br>
* kernel, process context<br>
* kernel, interrupt context<br>
<br>
but that's clearly(?) an incomplete (or not refined enough) list,<br>
since it doesn't include kernel threads, and a quick google showed<br>
this:<br>
<br>
<a href="http://stackoverflow.com/questions/9389688/in-what-context-kernel-thread-runs-in-linux" target="_blank">http://stackoverflow.com/questions/9389688/in-what-context-kernel-thread-runs-in-linux</a><br>
<br>
so is there a more refined or up-to-date list of contexts which<br>
explains them fairly well, including the subtle distinctions? thanks.<br>
<br>
rday<br>
<br>
--<br>
<br>
========================================================================<br>
Robert P. J. Day Ottawa, Ontario, CANADA<br>
<a href="http://crashcourse.ca" target="_blank">http://crashcourse.ca</a><br>
<br>
Twitter: <a href="http://twitter.com/rpjday" target="_blank">http://twitter.com/rpjday</a><br>
LinkedIn: <a href="http://ca.linkedin.com/in/rpjday" target="_blank">http://ca.linkedin.com/in/rpjday</a><br>
========================================================================<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="arial, helvetica, sans-serif">Gaurav Jain</font><div><font face="arial, helvetica, sans-serif">Associate Software Engineer</font></div>
<div><font face="arial, helvetica, sans-serif">VxVM Escalations Team, SAMG<br></font></div><div><font face="arial, helvetica, sans-serif">Symantec Software India Pvt. Ltd.</font></div><div><font face="arial, helvetica, sans-serif"><br>
<br></font></div></div><br>
</div></div>