No address space for Linux Kernel threads

后端 未结 2 735
既然无缘
既然无缘 2021-02-04 19:48

Why the Linux kernel threads do not have an address space. For any task to execute, it should have a memory region right? Where do the text and data of kernel threads go?

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-04 20:06

    Kernel threads do have an address space. It's just that they all share the same one. This does not prevent them from each having a different stack.

    Text and data are laid out in the kernel address space (the one that is shared by all the threads), depending on how and when it was allocated, and what it's used for.

    The Linux MM site has a lot of documentation about this aspect of Linux. Head over there.

提交回复
热议问题