Gentoo Archives: gentoo-user

From: Zhengquan Zhang <zhang.zhengquan@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] cpu TIME question in ps command
Date: Tue, 14 Apr 2009 16:37:37
Message-Id: 20090414163623.GA24603@m364d1.ece.northwestern.edu
1 Dear gentoo community:
2 I have got a old gentoo server
3 Linux *** 2.4.28-gentoo-r6 #1 Fri Feb 18 08:08:30 CST
4 2005 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz GNU/Linux
5
6 I am confused by a ps command problem.
7
8 I used
9 'ps -F -u root --sort bsdtime' to sort root processes by cumulative cpu
10 time and got the following.
11
12 keventd has a cumulative cpu time of 10 seconds.
13 and the kswapd has a cpu time 2day 11hours 2 minutes and 7seconds.
14
15 but why is keventd listed before kswapd. I am confused as to how ps sort
16 the cumulative cpu time.
17
18 Thanks for any help!
19
20 Zhengquan
21
22
23 UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
24 root 1 0 0 353 436 0 2008 ? 05:56:54 init [3]
25 root 2 1 0 0 0 0 2008 ? 00:00:10 [keventd]
26 root 3 1 0 0 0 0 2008 ? 09:54:58 [ksoftirqd_CPU0]
27 root 4 1 0 0 0 0 2008 ? 2-11:02:07 [kswapd]
28 root 5 1 0 0 0 0 2008 ? 00:00:46 [bdflush]
29 root 6 1 0 0 0 0 2008 ? 06:04:53 [kupdated]
30 root 8 1 0 0 0 0 2008 ? 00:00:00 [khubd]
31 root 15 1 0 0 0 0 2008 ? 05:10:19 [kjournald]
32 root 9311 1 0 477 752 0 2008 ? 00:00:10 /sbin/devfsd /dev
33 root 28165 1 0 0 0 0 2008 ? 00:00:04 [kjournald]
34 root 8470 1 0 0 0 0 2008 ? 09:32:13 [kjournald]
35 root 24381 1 0 0 0 0 2008 ? 1-14:42:25 [kjournald]
36 root 15836 1 0 1357 1788 0 2008 ? 16:32:01 /usr/sbin/cupsd
37 root 13313 1 0 452 696 0 2008 ? 01:06:56 /usr/sbin/smartd -p /var/run/smartd.pid
38 root 246 1 0 425 548 0 2008 ? 00:37:37 /usr/sbin/cron
39 root 23436 1 0 373 412 0 2008 vc/3 00:00:00 /sbin/agetty 38400 tty3 linux
40 root 10731 1 0 362 412 0 2008 vc/4 00:00:00 /sbin/agetty 38400 tty4 linux
41 root 2445 1 0 373 412 0 2008 vc/5 00:00:00 /sbin/agetty 38400 tty5 linux
42 root 12186 1 0 364 412 0 2008 vc/6 00:00:00 /sbin/agetty 38400 tty6 linux
43 root 27503 1 0 366 448 0 Jan09 vc/1 00:00:00 /sbin/agetty 38400 tty1 linux
44 root 20777 1 0 464 828 0 Jan23 ? 01:25:06 /usr/sbin/syslog-ng
45 root 28532 1 0 356 368 0 Jan23 ? 00:00:00 /usr/sbin/courierlogger -pid=/var/run/authdaemon.pid -start /usr/lib/courier/courier-authlib/authdaemond
46 root 10491 28532 0 456 448 0 Jan23 ? 00:01:03 /usr/lib/courier/courier-authlib/authdaemond
47 root 14333 10491 0 506 676 0 Jan23 ? 00:01:08 /usr/lib/courier/courier-authlib/authdaemond
48 root 11516 10491 0 506 676 0 Jan23 ? 00:01:10 /usr/lib/courier/courier-authlib/authdaemond
49 root 3605 10491 0 506 716 0 Jan23 ? 00:01:08 /usr/lib/courier/courier-authlib/authdaemond
50 root 7602 10491 0 506 680 0 Jan23 ? 00:01:09 /usr/lib/courier/courier-authlib/authdaemond
51 root 5834 10491 0 506 680 0 Jan23 ? 00:01:10 /usr/lib/courier/courier-authlib/authdaemond
52 root 12017 1 0 663 496 0 Jan23 ? 00:00:00 /usr/sbin/famd -T 0 -c /etc/fam.conf
53 root 10927 1 0 373 452 0 Jan23 ? 00:00:01 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/lib/courier-imap/courierlogger -stderrloggername=imapd -maxprocs=40 -maxperip=4 -pid=/var/run/imapd.pid -nodnslookup -noidentlookup 143 /usr/sbin/imaplogin /usr/lib/courier-imap/courier-imapd.indirect .maildir
54 root 5277 1 0 347 416 0 Jan23 ? 00:00:03 /usr/lib/courier-imap/courierlogger imapd
55 root 11307 1 0 387 456 0 Jan23 ? 00:00:41 /usr/lib/courier-imap/couriertcpd -address=0 -stderrlogger=/usr/lib/courier-imap/courierlogger -stderrloggername=imapd-ssl -maxprocs=40 -maxperip=4 -pid=/var/run/imapd-ssl.pid -nodnslookup -noidentlookup 993 /usr/sbin/couriertls -server -tcpd /usr/sbin/imaplogin /usr/lib/courier-imap/courier-imapd.indirect .maildir
56 root 32456 1 0 361 420 0 Jan23 ? 00:00:03 /usr/lib/courier-imap/courierlogger imapd-ssl
57 root 21326 1 0 846 1040 0 Jan23 ? 00:02:47 /usr/sbin/sshd
58 root 1876 1 0 567 664 0 Jan30 vc/2 00:00:00 /bin/login --
59 root 10105 1 0 1511 3884 0 Mar27 ? 00:00:48 SCREEN
60 root 635 10105 0 698 1384 0 Mar27 pts/1 00:00:01 -/bin/bash
61 root 30443 1 0 1040 748 0 Mar31 ? 00:00:01 SCREEN
62 root 3907 30443 0 691 1024 0 Mar31 pts/6 00:00:00 -/bin/bash
63 root 5244 30443 0 696 1028 0 Mar31 pts/7 00:00:00 -/bin/bash
64 root 5442 30443 0 691 1024 0 Mar31 pts/8 00:00:00 -/bin/bash
65 root 5249 30443 0 694 1028 0 Mar31 pts/9 00:00:00 -/bin/bash
66 root 17407 30443 0 690 1016 0 Mar31 pts/10 00:00:00 -/bin/bash
67 root 17527 246 0 506 712 0 Apr01 ? 00:00:00 /usr/sbin/cron
68 root 2262 246 0 506 676 0 Apr05 ? 00:00:00 /usr/sbin/cron
69 root 22682 246 0 506 676 0 Apr06 ? 00:00:00 /usr/sbin/cron
70 root 16279 246 0 506 712 0 Apr07 ? 00:00:00 /usr/sbin/cron
71 root 28555 1 0 915 1056 0 Apr07 ? 00:00:01 SCREEN
72 root 22936 28555 0 693 1304 0 Apr07 pts/12 00:00:00 -/bin/bash
73 root 15033 28555 0 684 1024 0 Apr07 pts/13 00:00:00 -/bin/bash
74 root 2852 28555 0 683 1056 0 Apr07 pts/14 00:00:00 -/bin/bash
75 root 6294 246 0 506 716 0 Apr08 ? 00:00:00 /usr/sbin/cron
76 root 13490 246 0 506 712 0 Apr09 ? 00:00:00 /usr/sbin/cron
77 root 14662 1 0 5011 6220 0 Apr09 ? 00:01:21 /usr/sbin/apache2 -D SSL -D PHP5 -D DEFAULT_VHOST -D USERDIR -d /usr/lib/apache2 -f /etc/apache2/httpd.conf -E /var/log/apache2/startuperror.log -k start
78 root 8675 246 0 506 800 0 Apr10 ? 00:00:00 /usr/sbin/cron
79 root 19386 1 0 1178 3196 0 Apr10 ? 00:00:01 SCREEN
80 root 28344 19386 0 696 1624 0 Apr10 pts/19 00:00:00 -/bin/bash
81 root 7656 19386 0 694 1624 0 Apr10 pts/20 00:00:00 -/bin/bash
82 root 16226 19386 0 697 1644 0 Apr10 pts/21 00:00:00 -/bin/bash
83 root 17092 1 0 1183 1444 0 Apr10 ? 00:00:13 /usr/lib/postfix/master
84 root 22530 246 0 506 800 0 Apr11 ? 00:00:00 /usr/sbin/cron
85 root 31366 246 0 506 800 0 Apr12 ? 00:00:00 /usr/sbin/cron
86 root 6242 246 0 506 800 0 Apr13 ? 00:00:00 /usr/sbin/cron
87 root 11524 246 0 506 800 0 01:00 ? 00:00:00 /usr/sbin/cron
88 root 17496 21326 0 1553 1936 0 09:12 ? 00:00:00 sshd: jwanka [priv]
89 root 2355 21326 0 1601 2188 0 09:48 ? 00:00:00 sshd: root@pts/0
90 root 21053 2355 0 694 1632 0 09:48 pts/0 00:00:00 -bash
91 root 14330 21053 0 625 932 0 09:49 pts/0 00:00:00 screen -r 10105.pts-0.ccl
92 root 14769 11307 0 679 1428 0 09:52 ? 00:00:00 /usr/sbin/couriertls -server -tcpd /usr/sbin/imaplogin /usr/lib/courier-imap/courier-imapd.indirect .maildir
93 root 2292 10105 0 685 1632 0 10:52 pts/2 00:00:00 -/bin/bash
94 root 19138 10105 0 686 1628 0 10:53 pts/3 00:00:00 -/bin/bash
95 root 2115 11307 0 686 1428 0 11:28 ? 00:00:00 /usr/sbin/couriertls -server -tcpd /usr/sbin/imaplogin /usr/lib/courier-imap/courier-imapd.indirect .maildir
96 root 4729 2292 0 513 876 0 11:29 pts/2 00:00:00 ps -F -u root --sort time
97
98
99 --
100 Zhengquan