kernel stack for linux process

后端 未结 4 903
自闭症患者
自闭症患者 2021-01-31 18:35

Is the kernel stack for all process shared or there is a seperate kernel stack for each process? If it is seperate for each process where is this stack pointer stored? In task_s

4条回答
  •  [愿得一人]
    2021-01-31 19:23

    There is just one common kernel memory. In it each process has it's own task_struct + kernel stack (by default 8K).

    In a context switch the old stack pointer is saved somewhere and the actual stack pointer is made to point to the top of the stack (or bottom depending on the hardware architecture) of the new process which is going to run.

提交回复
热议问题