process - Linux 2.6 内核中需要 thread_info 结构吗?

标签 process linux-kernel

在 Linux 2.6 内核之前,struct task_struct存在于每个进程的内核堆栈的末尾。没有thread_info struct概念。但在Linux 2.6内核中,而不是task_struct thread_info struct 被放置在进程内核堆栈的末尾。被放置在最后。这个thread_info结构体包含一个指向task_struct的指针。结构。

需要什么thread_info结构要介绍什么?我们本可以访问task_struct使用 stack pointer 的结构直接如果task_struct被放置在进程的内核堆栈的末尾。

在 2.6 内核中,task_struct使用slab_allocator动态分配。在 2.6 内核之前,它是静态分配的吗?

最佳答案

FrankH,他正在寻找(我怀疑是出于纯粹的兴趣)进行此更改的原因。这是我用我的 l33t 谷歌技能发现的。链接后面有更多信息:

"task_struct is huge. it's around 1,7KB on a 32 bit machine. on the other hand, you can easily see that thread_info is much slimmer.

kernel stack is either 4 or 8KB, and either way a 1.7KB is pretty much, so storing a slimmer struct, that points to task_struct, immediately saves a lot of stack space and is a scalable solution."

(c) http://www.spinics.net/lists/newbies/msg22263.html

关于process - Linux 2.6 内核中需要 thread_info 结构吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6134226/

相关文章:

c# - 如何将 ctrl+c 发送到 C# 中的进程?

c++ - 当守护线程在后台工作时返回一个函数 (c++)

android - 更改 root android 设备的 CPU 调速器

android - 32 位 x86 中的 VMALLOC 空间有多大?

c# - Process.Start 阻塞

linux - 在 linux 上通过 id 显示进程的详细信息

java - 我们可以使用 java 访问(打开-读/写)驱动程序文件/dev/aaa 吗?

linux - 什么是私有(private)页面?

java - 产生交互过程

powershell - 如何将输出从 PowerShell 中的外部进程捕获到变量中?