LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2011, 11:39 AM   #1
aggrishabh
Member
 
Registered: Nov 2010
Posts: 87

Rep: Reputation: 1
process id 0


Hi All,

Can someone shed some light on the role of process id 0 in linux. i know this process is for scheduler, but what this process do.

Please correct me if i am wrong.
 
Old 01-12-2011, 11:41 AM   #2
fbsduser
Member
 
Registered: Oct 2009
Distribution: Hackintosh, SlackWare
Posts: 267

Rep: Reputation: 30
IIRC. ID 0 is init.
 
Old 01-12-2011, 11:21 PM   #3
aaaaatoz
LQ Newbie
 
Registered: Jan 2010
Posts: 10

Rep: Reputation: 0
Quote:
Originally Posted by fbsduser View Post
IIRC. ID 0 is init.
I am confused whether init's PID is 0 or 1 ?
 
Old 01-12-2011, 11:26 PM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by aaaaatoz View Post
I am confused whether init's PID is 0 or 1 ?
Also do a man init
Code:
anisha@linux-uitj:~>ps -el
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S     0     1     0  0  80   0 -  2018 poll_s ?        00:00:00 init
1 S     0     2     0  0  75  -5 -     0 kthrea ?        00:00:00 kthreadd
1 S     0     3     2  0 -40   - -     0 migrat ?        00:00:00 migration/0
1 S     0     4     2  0  75  -5 -     0 ksofti ?        00:00:04 ksoftirqd/0
5 S     0     5     2  0 -40   - -     0 watchd ?        00:00:00 watchdog/0 
1 S     0     9     2  0  75  -5 -     0 worker ?        00:00:00 events/0   
1 S     0    11     2  0  75  -5 -     0 worker ?        00:00:00 khelper    
1 S     0    12     2  0  75  -5 -     0 worker ?        00:00:00 netns      
1 S     0    13     2  0  75  -5 -     0 async_ ?        00:00:00 async/mgr  
1 S     0    14     2  0  75  -5 -     0 worker ?        00:00:00 kintegrityd/0
1 S     0    16     2  0  75  -5 -     0 worker ?        00:00:00 kblockd/0    
...
0 S  1000  6566  5281  0  80   0 -  3472 wait   pts/3    00:00:00 bash
0 R  1000  6587  6566  0  80   0 -  1139 -      pts/3    00:00:00 ps
0 S  1000  9750  5354  0  80   0 - 163619 poll_s pts/0   00:03:51 qtcreator
...
0 S  1000 16742  5281  0  80   0 -  3500 n_tty_ pts/2    00:00:00 bash
 
1 members found this post helpful.
Old 01-13-2011, 02:01 AM   #5
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by aggrishabh View Post
Hi All,

Can someone shed some light on the role of process id 0 in linux. i know this process is for scheduler, but what this process do.

Please correct me if i am wrong.
swapper or sched has process ID 0 and is responsible for paging during kernel initialization.

Last edited by divyashree; 01-13-2011 at 02:05 AM.
 
1 members found this post helpful.
Old 01-13-2011, 02:21 AM   #6
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
and putting the following keywords in Google will yield more results:
Quote:
Linux scheduler pid
 
1 members found this post helpful.
Old 01-14-2011, 07:40 AM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
My compliments on the way you suggested Google keywords -- nice phrasing, helpful, & polite.
 
Old 01-14-2011, 08:41 AM   #8
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Well, thank you, I could have given the OP link too but I wanted him to know how to form appropriate keywords to get the desired results from Google.
 
Old 01-14-2011, 08:47 AM   #9
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by divyashree View Post
swapper or sched has process ID 0 and is responsible for paging during kernel initialization.
Can you expound on this a bit?


What do you mean swapper OR sched? And what do you mean "paging during kernel initialization"?

Last edited by resetreset; 01-14-2011 at 08:49 AM.
 
Old 01-14-2011, 08:52 AM   #10
deeh514
LQ Newbie
 
Registered: Jan 2011
Posts: 10

Rep: Reputation: 0
@Anisha....i think it's time for a link :P
 
Old 01-14-2011, 09:28 AM   #11
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by deeh514 View Post
@Anisha....i think it's time for a link :P
Welcome to LQ!
 
Old 01-16-2011, 04:52 AM   #12
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
thanks, but I still don't get what "paging during kernel initialization" is.....
 
Old 01-17-2011, 01:01 AM   #13
divyashree
Senior Member
 
Registered: Apr 2007
Location: Bangalore, India
Distribution: RHEL,SuSE,CentOS,Fedora,Ubuntu
Posts: 1,386

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by resetreset View Post
thanks, but I still don't get what "paging during kernel initialization" is.....
Do you know what is paging ? Please google for details. Its a beautiful memory mgmt. technique used by the kernel.

Our primary memory is divided into some logical blocks of same size called pages, by the kernel.

swapper or sched is the swapper daemon which swaps processes from primary memory to swap area(virtual memory) whenever needed i.e to free the pages from primary memory. And during kernel initialization, kernel starts the swapper daemon(sched) to do this.
 
Old 01-19-2011, 01:03 AM   #14
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
I am extremely well aware what paging is. There is no "paging during kernel initialization" - the x86 *chip* will simply take addresses that are not in RAM, and the kernel has to bring that data off the disk. This whole thing is activated when the chip is put into Protected Mode, it's not the *kernel* which does anything.
 
Old 01-19-2011, 02:46 AM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Hmmmm.
Swapper has nothing to do with (modern) swap. In fact process swap-out in Linux hasn't existed for years. kswapd manages pages to swap.
The kernel doesn't page, although it does have page table built for it - by "swapper/process 0" I believe. Who knows where the name came from originally.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Signal from Child Process to Parent Process : Not getting desired output thelink123 Linux - General 4 10-26-2012 09:05 PM
how to kill or clean a Uninterruptible slept session leader process from process tabl golden_boy615 Linux - General 1 12-14-2010 10:47 AM
Finding the Process ID of a Process While Initiating the Process senthilmuthiah Linux - Newbie 7 04-02-2009 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration