在 fork() 过程中, child 明明得到了一个新的内核堆栈,但是 fork() 手册页却没有提到这一点?

In the fork() process, child clearly gets a new kernel stack, but fork() man pages fails to mention that?

我正在经历 fork() 流程和执行的步骤,主要是为了详细了解 parent 和 child 流程之间共享和不共享的内容。

所以在 dup_task_struct() 函数中我可以清楚地看到它正在使用 alloc_thread_stack_node() 分配一个新堆栈(尽管与 parent 在同一个 numa 节点上),并且它是然后将其分配给将创建的 child 进程 task_struct

stack = alloc_thread_stack_node(tsk, node);
.
.
tsk->stack = stack;

这意味着 parent 和 child 不共享内核堆栈..

但是当我浏览 man pages of fork() 以确认我的发现时,我没有找到任何提及此类信息的信息。

有一节说了 parent 和 child 不共享的东西

The child process is an exact duplicate of the parent process except for the following points:

但它没有提到内核堆栈。

我是不是漏掉了什么?

Linux 程序员手册 中的手册页从应用程序 开发人员的角度描述了一些事情。

从那时起,只有 user 部分 进程(以 user-space 模式运行代码) , 并且只描述那些与用户进程相关的属性。

内核状态的描述超出了该手册页的范围。此外,fork 是 POSIX 标准的一部分,而 Linux 并不是唯一实现该标准的 OS。其他 OS'es 可能有另一个内核部分,它在 fork.

上表现不同