lkml.org 
[lkml]   [2010]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: init_task belongs to "process 0" or "process 1"?
From
init_task is the head of doubly linked list which holds all
task_structs in the system. init_task is again the task_struct for
process 0/swapper/idle task. This process is created manually (I meant
to say not by copy_process() calls). Manually means they are static
structures defined in the code (see INIT_TASK, init_mm, init_fs etc).
There will be multiple idle task if there is more than 1 cpu core.
Idle task is the one which is scheduled if there is no other task
ready for scheduling.

Init task is process 1 which is initially a kernel thread created from
process 0 using copy_process(), then it does an execv() (/sbin/init )
or similar one to create the normal process init.

Name given to process 0 is swapper.
.comm = "swapper"


On Mon, Jan 4, 2010 at 1:37 PM, Shivdas Gujare <shivdas.tech@gmail.com> wrote:
> Hi all,
>
> I am trying to understand the role of linux kernel "process 0" i.e. swapper.
> I am not able to understand, where it gets started? and Does
> "init_task" from arch/arm/kernel/init_task.c belongs to "swapper" or
> "init"?
> whats the purpose of "init_task"?
>
> Thanks for your help.
>
> Thanks and Regards,
> Shivdas Gujare
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-01-05 08:35    [W:1.677 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site