Re: Which process is associated with process ID 0 (swapper)

From: linux-os (Dick Johnson)
Date: Thu Apr 20 2006 - 11:30:37 EST



On Thu, 20 Apr 2006, Mikado wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> When a process make a connection to one server, if the server doesn't
> respond, the swapper process (PID 0) will re-send SYN packet
> automatically. How can I know which socket/process that re-sent SYN
> packet belongs to.
>
> Thanks in advance,
> Mikado.

This must be a trick question. Linux is not VAX/VMS. There is no
swapper process. Check in /proc. Processes start at 1. Even
kernel threads have PIDs greater than 1.

Portions of the kernel networking code operate detached. The code
gets the CPU from a timer queue or from an interrupt. When an
connection is attempted, the process attempting the connection
is either waiting, with its CPU time being used, or put to
sleep, while the timer queue's CPU time is being used. The
SYN/ACK handshake is handled during this time, therefore it
is possible to find who is attempting that connection. Netstat
gets that information from /proc/net and multiple socket
calls.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.4 on an i686 machine (5592.89 BogoMips).
Warning : 98.36% of all statistics are fiction, book release in April.
_


****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/