On Mon, Mar 16, 2009 at 3:54 PM, Manish Katiyar <[email protected]> wrote:
> On Mon, Mar 16, 2009 at 2:20 PM, Mulyadi Santosa
> <[email protected]> wrote:
>> On Sat, Mar 14, 2009 at 5:35 PM, Gaurav Tewari <[email protected]> wrote:
>>> Hi all,
>>> linux switch_to function which actually does the context switch, very
>>> smartly preserves the 'last' field of prev task_struct across context switch
>>> (the third argument of switch_to()), but where and how does it uses that
>>> argument...or saved value...
>>
>> Understanding The Linux Kernel 3rd edition completely describe it in
>> the "process switching" section. It has something to do with stack
>> juggling.... IIRC it does so, for example when process A goes to B,
>> and when B want to goes back A, the pointer is already saved
>>
>> That's all I could recall this moment...CMIIW people
>
> Is it because we manipulate the stack to save the instruction of the
> next process at the old eip (returning address), so that when the
> stack unwinds it will try to execute the return address and since we
> have the instruction on next process there we switch tasks

That could be the reason. This is also the part that I don't fully
understand since the early day I learnt about Linux kernel.

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to