Re: Can you use current->pid at the driver level

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Linux or any UNIX platform process with PID 1 is init process and process with PID 0 is a swapper process.

A process on a UNIX system is created by fork system call. Every process except the process with PID 0 is created when another process executes the fork system call. The Process 0 is created by hand when the system boots; after forking a child (process with PID 1), process 0 becomes the swpper process. Process 1, is known as init, and is the ancestor of every other process in the system.

The command "ps -p 1" will show the process having PID=1, this is how the output looked on my machine.
lopgod50:~ # ps -p 1 -o pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
  PID   TID CLS RTPRIO  NI PRI PSR %CPU STAT WCHAN          COMMAND
    1     1 TS       -   0  23   1  0.0 S    schedule       init

Check the same for process having PID 0 use command ps -p0

Thanks and Regards,
Prasad.

On 6/7/07, Devvrat Tripathi <tripathidevvrat@xxxxxxxxx> wrote:


On 6/7/07, Devvrat Tripathi < tripathidevvrat@xxxxxxxxx> wrote:


On 6/7/07, Erik Mouw <mouw@xxxxxxxxxxxx > wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Jun 07, 2007 at 12:02:03PM +0200, Devvrat Tripathi wrote:
> I wanted to ask you if current pid will work at the driver level. i used in
> pci-gart.c to get the processes which are using DMA transfer but stragely i
> get 0 sometimes and sometime proper pid's.

0 is a proper pid as well, it's the "swapper" task.


Erik

what is a "Swapper" task. Can you explain what work does it do and why does it do so many IO transfers.

devvrat

Also this is what wikipedia says of idle task.

" In Unix-like operating systems such as Linux, the idle task has process ID zero, and never exits.  "

but the results which i am getting show that this task does exist and is initiating so many DMA transfers. what can be the possible reason for it or is it that i am missing something?

devvrat


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux