From owner-freebsd-current@FreeBSD.ORG Fri May 6 06:31:36 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7379106564A for ; Fri, 6 May 2011 06:31:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFF18FC0C for ; Fri, 6 May 2011 06:31:36 +0000 (UTC) Received: by vxc34 with SMTP id 34so4184574vxc.13 for ; Thu, 05 May 2011 23:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=MGXz85FJ4YmdZ6TOBbjqmYGHKmnJ8LD6ztJ0LjMdKX4=; b=eionPsNMqQVLUYQrUbjd4W+twNkIaPhW0edHEKulZXsGNJpVlgOBXTWhH8j15ZbD7+ uDLVwjhMLF3dVagy4524xA71zIYP2SfUIiDy70nKnL3dJQ2CKGwFz/Bfm4lNplUHTRMw rU2uhscooMcxCgkRoxD3UZNC7Eem8hzutfIN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OOw4qjM6pnhjUaKHYfHQ8YHRiW7k1DdbfeNYpEE+I5HE+S5nb6kbBe2qD0YxE5LVjC r+nYEAHp3AqmkEyrlf0N89Rs38kewTrRDTOaMBQmZ1ZJj4Fz/YkSpdV4SLDKBdgrLBKn z/s78HJXYVAd5Qxsok/R5+256z/WfV62tCrEA= MIME-Version: 1.0 Received: by 10.52.91.71 with SMTP id cc7mr1222489vdb.288.1304663495775; Thu, 05 May 2011 23:31:35 -0700 (PDT) Received: by 10.220.199.130 with HTTP; Thu, 5 May 2011 23:31:35 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 May 2011 23:31:35 -0700 Message-ID: From: Garrett Cooper To: Sergey Kandaurov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Current Subject: Re: Processes in swapped out states in recent CURRENT? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2011 06:31:36 -0000 On Thu, May 5, 2011 at 11:28 PM, Sergey Kandaurov wrote= : > On 6 May 2011 00:33, Garrett Cooper wrote: >> =A0 =A0I was watching top output on my dev box and I noticed that there >> are more swapped out processes present on the system, shortly after >> boot (which doesn't make sense given that I'm not low on resources on >> the box). Also, the os when I run os.waitpid() in python claims that >> the child doesn't exist, so I'm wondering if there's an issue with the >> processes reported via ps, top, etc. >> =A0 =A0I'm noting this because it's a behavior change over my >> 'stable'-ish workstation, running CURRENT/r220089/amd64, which is >> spec'ed out the same as the dev box, minus some multimedia hardware. >> Thanks, >> -Garrett >> >> # uname -a >> FreeBSD fallout.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r221219M: Thu >> May =A05 12:09:37 PDT 2011 >> root@fallout.local:/usr/obj/usr/src/sys/FALLOUT =A0amd6 >> # fstat -p 1832 >> USER =A0 =A0 CMD =A0 =A0 =A0 =A0 =A0PID =A0 FD MOUNT =A0 =A0 =A0INUM MOD= E =A0 =A0 =A0 =A0 SZ|DV R/W >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 root / =A0 =A0 =A0 =A0 =A0 =A0 2 d= rwxr-xr-x =A0 =A01024 =A0r >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 wd / =A0 =A0 =A0 =A0 =A0 =A0 2= drwxr-xr-x =A0 =A01024 =A0r >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 text /usr =A0 =A0 730118 -r-xr-xr-= x =A0240944 =A0r >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A00 /dev =A0 =A0 =A0 =A0 =A06= crw-rw-rw- =A0 =A0null =A0r >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A01 /dev =A0 =A0 =A0 =A0 =A06= crw-rw-rw- =A0 =A0null rw >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A02 /dev =A0 =A0 =A0 =A0 =A06= crw-rw-rw- =A0 =A0null rw >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A03* internet stream tcp ffff= fe01e56cf000 >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A04* pseudo-terminal master = =A0 =A0 =A0pts/1 rw >> root =A0 =A0 sshd =A0 =A0 =A0 =A01832 =A0 =A05* local stream fffffe0008f= 79960 <-> >> fffffe0008f79a50 >> # fstat -p 149 >> USER =A0 =A0 CMD =A0 =A0 =A0 =A0 =A0PID =A0 FD MOUNT =A0 =A0 =A0INUM MOD= E =A0 =A0 =A0 =A0 SZ|DV R/W >> root =A0 =A0 adjkerntz =A0 =A0149 root / =A0 =A0 =A0 =A0 =A0 =A0 2 drwxr= -xr-x =A0 =A01024 =A0r >> root =A0 =A0 adjkerntz =A0 =A0149 =A0 wd / =A0 =A0 =A0 =A0 =A0 =A0 2 drw= xr-xr-x =A0 =A01024 =A0r >> root =A0 =A0 adjkerntz =A0 =A0149 text / =A0 =A0 =A0 =A0329805 -r-xr-xr-= x =A0 =A08792 =A0r >> root =A0 =A0 adjkerntz =A0 =A0149 =A0 =A00 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> root =A0 =A0 adjkerntz =A0 =A0149 =A0 =A01 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> root =A0 =A0 adjkerntz =A0 =A0149 =A0 =A02 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> # fstat -p 1479 >> USER =A0 =A0 CMD =A0 =A0 =A0 =A0 =A0PID =A0 FD MOUNT =A0 =A0 =A0INUM MOD= E =A0 =A0 =A0 =A0 SZ|DV R/W >> root =A0 =A0 syslogd =A0 =A0 1479 root / =A0 =A0 =A0 =A0 =A0 =A0 2 drwxr= -xr-x =A0 =A01024 =A0r >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 wd / =A0 =A0 =A0 =A0 =A0 =A0 2 drw= xr-xr-x =A0 =A01024 =A0r >> root =A0 =A0 syslogd =A0 =A0 1479 text /usr =A0 =A0 739002 -r-xr-xr-x = =A0 39008 =A0r >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A00 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A01 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A02 /dev =A0 =A0 =A0 =A0 =A06 crw= -rw-rw- =A0 =A0null rw >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A03 /var =A0 =A0 353301 -rw------= - =A0 =A0 =A0 4 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A04* local dgram fffffe0008cd31e0 >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A05* local dgram fffffe0008cd30f0 >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A06* internet6 dgram udp fffffe00= 08ced540 >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A07* internet dgram udp fffffe000= 8ced3f0 >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 =A08 /dev =A0 =A0 =A0 =A0 29 crw--= ----- =A0 =A0klog =A0r >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 10 /var =A0 =A0 1389613 -rw-r--r--= =A0 25389 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 11 /var =A0 =A0 1389579 -rw-------= =A0 =A0 =A062 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 12 /var =A0 =A0 1389572 -rw-------= =A0 10164 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 13 /var =A0 =A0 1389601 -rw-r-----= =A0 =A02814 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 14 /var =A0 =A0 1389575 -rw-r--r--= =A0 =A0 =A062 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 15 /var =A0 =A0 1389580 -rw-------= =A0 =A0 =A062 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 16 /var =A0 =A0 1389577 -rw-------= =A0 57212 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 17 /var =A0 =A0 1389606 -rw-------= =A0 38046 =A0w >> root =A0 =A0 syslogd =A0 =A0 1479 =A0 18 /var =A0 =A0 1389578 -rw-r-----= =A0 =A0 =A062 =A0w >> # fstat -p 1829 >> USER =A0 =A0 CMD =A0 =A0 =A0 =A0 =A0PID =A0 FD MOUNT =A0 =A0 =A0INUM MOD= E =A0 =A0 =A0 =A0 SZ|DV R/W >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 root / =A0 =A0 =A0 =A0 =A0 =A0 2 d= rwxr-xr-x =A0 =A01024 =A0r >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 =A0 wd /usr =A0 =A0 1884160 drwxr-= xr-x =A0 =A01024 =A0r >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 text / =A0 =A0 =A0 =A0212057 -r-xr= -xr-x =A0131784 =A0r >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 =A0 =A00 /dev =A0 =A0 =A0 =A0127 c= rw--w---- =A0 pts/0 rw >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 =A0 =A01 /dev =A0 =A0 =A0 =A0127 c= rw--w---- =A0 pts/0 rw >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 =A0 =A02 /dev =A0 =A0 =A0 =A0127 c= rw--w---- =A0 pts/0 rw >> gcooper =A0sh =A0 =A0 =A0 =A0 =A01829 =A0 10 /dev =A0 =A0 =A0 =A0127 crw= --w---- =A0 pts/0 rw >> >> # python -c 'import os; os.waitpid(1825, 0)' >> Traceback (most recent call last): >> =A0File "", line 1, in >> OSError: [Errno 10] No child processes > > But pid 1825 (sshd) is not a child process of the python process , isn't = it? > > from waitpid(2): > =A0 =A0 [ECHILD] =A0 =A0 =A0 =A0 =A0 The calling process has no existing = unwaited-for child > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0processes. > > Look at /sys/kern/kern_exit.c:kern_wait(). The function returns ECHILD if > a specified process was not found among p->p_children children group. Yeah, good point. I'd have to use kill(, 0) in that case. >> # ps auxww | grep 1825 >> root =A0 =A0 1825 =A0 0.0 =A00.0 =A047952 =A0 =A0 =A00 =A0?? =A0IWs =A0-= =A0 =A0 =A0 =A0 0:00.00 >> sshd: gcooper [priv] (sshd) >> root =A0 =A088213 =A0 0.0 =A00.0 =A016340 =A0 1356 =A0 3 =A0S+ =A0 =A01:= 25PM =A0 0:00.00 grep 1825 >> # top -b >> last pid: 96740; =A0load averages: =A01.07, =A00.98, =A00.92 =A0up 0+01:= 15:32 =A0 =A013:27:04 >> 50 processes: =A02 running, 48 sleeping >> >> Mem: 56M Active, 23M Inact, 795M Wired, 1848K Cache, 1237M Buf, 11G Free >> Swap: 24G Total, 832K Used, 24G Free >> >> >> =A0PID USERNAME =A0THR PRI NICE =A0 SIZE =A0 =A0RES STATE =A0 C =A0 TIME= =A0 WCPU >> COMMAND >> =A01828 gcooper =A0 =A0 1 =A020 =A0 =A00 47952K =A03372K select =A06 =A0= 0:02 =A00.00% sshd >> 26295 root =A0 =A0 =A0 =A01 =A020 =A0 =A00 =A09972K =A0 888K kqread =A02= =A0 0:01 =A00.00% tail >> 95888 root =A0 =A0 =A0 =A01 =A052 =A0 =A00 14472K =A08092K wait =A0 =A01= =A0 0:00 =A00.00% make >> =A01729 root =A0 =A0 =A0 =A01 =A020 =A0 =A00 20368K =A03000K select =A02= =A0 0:00 =A00.00% sendmail >> 59474 gcooper =A0 =A0 1 =A020 =A0 =A00 47952K =A03768K select =A07 =A0 0= :00 =A00.00% sshd >> 57339 root =A0 =A0 =A0 =A01 =A052 =A0 =A00 =A06280K =A01168K wait =A0 = =A01 =A0 0:00 =A00.00% make >> 75210 gcooper =A0 =A0 1 =A020 =A0 =A00 47952K =A03816K select =A05 =A0 0= :00 =A00.00% sshd >> 82431 root =A0 =A0 =A0 =A01 =A052 =A0 =A00 =A06280K =A01148K wait =A0 = =A02 =A0 0:00 =A00.00% make >> 94797 root =A0 =A0 =A0 =A01 =A052 =A0 =A00 =A06280K =A01164K wait =A0 = =A02 =A0 0:00 =A00.00% make >> 59441 root =A0 =A0 =A0 =A01 =A021 =A0 =A00 47952K =A03772K sbwait =A04 = =A0 0:00 =A00.00% sshd >> =A01825 root =A0 =A0 =A0 =A01 =A021 =A0 =A00 47952K =A0 =A0 0K sbwait = =A01 =A0 0:00 =A00.00% >> 75167 root =A0 =A0 =A0 =A01 =A021 =A0 =A00 47952K =A03820K sbwait =A01 = =A0 0:00 =A00.00% sshd >> =A01832 root =A0 =A0 =A0 =A01 =A020 =A0 =A00 47952K =A0 =A0 0K sbwait = =A01 =A0 0:00 =A00.00% >> 96738 root =A0 =A0 =A0 =A01 =A072 =A0 =A00 17184K =A09756K CPU0 =A0 =A00= =A0 0:00 =A00.00% cc1 >> =A01479 root =A0 =A0 =A0 =A01 =A020 =A0 =A00 12228K =A01372K select =A04= =A0 0:00 =A00.00% syslogd >> 75237 root =A0 =A0 =A0 =A01 =A020 =A0 =A00 17612K =A02424K ttyin =A0 4 = =A0 0:00 =A00.00% bash >> =A01835 gcooper =A0 =A0 1 =A020 =A0 =A00 47952K =A03284K select =A02 =A0= 0:00 =A00.00% sshd >> 57233 root =A0 =A0 =A0 =A01 =A052 =A0 =A00 =A06280K =A0 756K wait =A0 = =A02 =A0 0:00 =A00.00% make