From 4e08a7e4268d6c1742ea2e474df995c0bd1dac2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Dost=C3=A1l?= Date: Sat, 22 Jul 2017 20:11:34 +0200 Subject: [PATCH] Initialization: make grep command more precise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Idea is clearly to grep for "kthreadd", even though grepping for "kthread" will also work. Signed-off-by: Radek Dostál --- Initialization/linux-initialization-10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Initialization/linux-initialization-10.md b/Initialization/linux-initialization-10.md index a56d86f..0f82498 100644 --- a/Initialization/linux-initialization-10.md +++ b/Initialization/linux-initialization-10.md @@ -260,7 +260,7 @@ Here the `kernel_thread` function (defined in the [kernel/fork.c](https://github We will not dive into details about `kernel_thread` implementation (we will see it in the chapter which describe scheduler, just need to say that `kernel_thread` invokes [clone](http://www.tutorialspoint.com/unix_system_calls/clone.htm)). Now we only need to know that we create new kernel thread with `kernel_thread` function, parent and child of the thread will use shared information about filesystem and it will start to execute `kernel_init` function. A kernel thread differs from a user thread that it runs in kernel mode. So with these two `kernel_thread` calls we create two new kernel threads with the `PID = 1` for `init` process and `PID = 2` for `kthreadd`. We already know what is `init` process. Let's look on the `kthreadd`. It is a special kernel thread which manages and helps different parts of the kernel to create another kernel thread. We can see it in the output of the `ps` util: ```C -$ ps -ef | grep kthread +$ ps -ef | grep kthreadd root 2 0 0 Jan11 ? 00:00:00 [kthreadd] ```