Re: 2.1.110 odd swapping

George (greerga@nidhogg.ham.muohio.edu)
Wed, 22 Jul 1998 21:39:07 -0400 (EDT)


On 23 Jul 1998, Linus Torvalds wrote:

>One thing to look out for is that if you're using "xntpd" to keep your
>machine synchronized to the network, then it will mlock() itself into
>memory, and at least for me that means that about 1.2MB of your memory
>is completely untouchable by the kernel.

What would have been running at the time:

PID TTY STAT TIME COMMAND
1 ? S 0:04 init
2 ? SW 0:00 (kflushd)
3 ? SW< 0:00 (kswapd)
9 ? S 0:00 /sbin/update
70 ? S 0:00 /usr/sbin/klogd -c 4 -k /System.map-2.1.110
71 ? S 0:00 /usr/sbin/syslogd
73 ? S 0:00 /usr/sbin/dhcpd
77 ? S 0:00 /usr/sbin/inetd
79 ? S 0:00 /usr/sbin/named
81 ? S 0:00 /usr/sbin/lpd
84 ? S 0:00 /usr/sbin/rpc.mountd
86 ? S 0:00 /usr/sbin/rpc.nfsd
89 ? S 0:00 /usr/sbin/crond -l10
95 ? S 0:00 sendmail: accepting connections on port 25
99 ? S 0:00 gpm -t ms -m /dev/ttyS0 -2
103 ? S 0:00 sh /etc/rc.d/rc.M
110 9 S 0:00 -bash
111 10 S 0:00 -bash
112 11 S 0:00 -bash
113 12 S 0:00 -bash
115 ? S 0:00 sh ./start
117 ? S N 0:00 ./rc5des runbuffers
118 ? S N 0:00 ./rc5des runbuffers

plus about 6 Apache's.

>That, together with the kernel itself using about a megabyte or so of
>memory, made a 4MB test machine completely unrunnable for me. Also
>verify that you aren't trying to profile the kernel you're running,
>because that will eat up another half meg of unswappable memory...

No profiling, no xntpd...

The kernel is:

(720k kernel code, 400k reserved, 972k data, 36k init)

Here's a couple snapshots after 1 minute of thrashing:

Free pages: 124kB
( Free: 31 (10 20 30)
11*4kB 4*8kB 3*16kB 0*32kB 0*64kB 0*128kB = 124kB)
Swap cache: add 12822/12822, delete 12788/12788, find 0/0
Free swap: 30244kB
1024 pages of RAM
342 reserved pages
97 pages shared
34 pages swap cached
1 pages in page table cache
Buffer memory: 120kB
Buffer heads: 190
Buffer blocks: 120
CLEAN: 82 buffers, 5 used (last=5), 0 locked, 0 protected, 0 dirty
LOCKED: 26 buffers, 16 used (last=23), 0 locked, 0 protected, 0 dirty
Networking buffers in use : 16
Total network buffer allocations : 92
Total failed network buffer allocs : 0
IP fragment buffer size : 0
SysRq: Show Memory
Mem-info:
Free pages: 84kB
( Free: 21 (10 20 30)
5*4kB 0*8kB 4*16kB 0*32kB 0*64kB 0*128kB = 84kB)
Swap cache: add 12865/12865, delete 12825/12825, find 0/0
Free swap: 30276kB
1024 pages of RAM
342 reserved pages
132 pages shared
40 pages swap cached
0 pages in page table cache
Buffer memory: 120kB
Buffer heads: 192
Buffer blocks: 120
CLEAN: 82 buffers, 5 used (last=5), 0 locked, 0 protected, 0 dirty
LOCKED: 26 buffers, 16 used (last=23), 0 locked, 0 protected, 0 dirty
Networking buffers in use : 16
Total network buffer allocations : 92
Total failed network buffer allocs : 0
IP fragment buffer size : 0
SysRq: Show Memory
Mem-info:
Free pages: 92kB
( Free: 23 (10 20 30)
3*4kB 2*8kB 4*16kB 0*32kB 0*64kB 0*128kB = 92kB)
Swap cache: add 12893/12893, delete 12855/12855, find 0/0
Free swap: 30312kB
1024 pages of RAM
342 reserved pages
120 pages shared
38 pages swap cached
0 pages in page table cache
Buffer memory: 120kB
Buffer heads: 202
Buffer blocks: 120
CLEAN: 82 buffers, 5 used (last=5), 0 locked, 0 protected, 0 dirty
LOCKED: 26 buffers, 16 used (last=23), 0 locked, 0 protected, 0 dirty
Networking buffers in use : 16
Total network buffer allocations : 93
Total failed network buffer allocs : 0
IP fragment buffer size : 0
SysRq: Show Memory
Mem-info:
Free pages: 120kB
( Free: 30 (10 20 30)
12*4kB 3*8kB 3*16kB 0*32kB 0*64kB 0*128kB = 120kB)
Swap cache: add 12944/12944, delete 12906/12906, find 0/0
Free swap: 30296kB
1024 pages of RAM
342 reserved pages
73 pages shared
39 pages swap cached
0 pages in page table cache
Buffer memory: 120kB
Buffer heads: 203
Buffer blocks: 120
CLEAN: 82 buffers, 5 used (last=5), 0 locked, 0 protected, 0 dirty
LOCKED: 26 buffers, 16 used (last=23), 0 locked, 0 protected, 0 dirty
Networking buffers in use : 16
Total network buffer allocations : 93
Total failed network buffer allocs : 0
IP fragment buffer size : 0
SysRq: Show Memory
Mem-info:
Free pages: 76kB
( Free: 19 (10 20 30)
1*4kB 3*8kB 3*16kB 0*32kB 0*64kB 0*128kB = 76kB)
Swap cache: add 12973/12973, delete 12917/12917, find 0/0
Free swap: 30308kB
1024 pages of RAM
342 reserved pages
142 pages shared
56 pages swap cached
0 pages in page table cache
Buffer memory: 120kB
Buffer heads: 191
Buffer blocks: 120
CLEAN: 82 buffers, 5 used (last=5), 0 locked, 0 protected, 0 dirty
LOCKED: 26 buffers, 16 used (last=23), 0 locked, 0 protected, 0 dirty
Networking buffers in use : 16
Total network buffer allocations : 93
Total failed network buffer allocs : 0
IP fragment buffer size : 0

What was running during the thrashing:

free sibling
task PC stack pid father child younger older
swapper -1 R current 0 0 0 1
sig: 0 0000000000000000 0000000000000000 : X
init 2 S C0106000 0 1 0 114 0
sig: 0 0000000000000000 0000000000000000 : X
kflushd 3 S C0008000 0 2 1 3
sig: 0 0000000000000000 0000000000000000 : X
kswapd 4 S C01FE000 0 3 1 9 2
sig: 0 0000000000000000 ffffffffffffffff : X
update 9 S C0106000 0 9 1 71 3
sig: 0 0000000000000000 0000000000000000 : X
syslogd 10 S C0106000 0 70 1 84 81
sig: 0 0000000000000000 0000000000000000 : X
klogd 7 D C01FE000 0 71 1 73 9
sig: 0 0000000000000000 0000000000000000 : X
dhcpd 11 S C0106000 0 73 1 75 71
sig: 0 0000000000000000 0000000000000000 : X
rpc.portmap 12 S C01FE000 0 75 1 77 73
sig: 0 0000000000000000 0000000000000000 : X
inetd 13 S C0106000 0 77 1 79 75
sig: 0 0000000000000000 0000000000000000 : X
named 14 D C0106000 0 79 1 81 77
sig: 0 0000000000000000 0000000000000000 : X
lpd 15 S C0106000 0 81 1 70 79
sig: 0 0000000000000000 0000000000000000 : X
rpc.mountd 6 S C0106000 0 84 1 86 70
sig: 0 0000000000000000 0000000000000000 : X
rpc.nfsd 16 S C01FE000 0 86 1 89 84
sig: 0 0000000000000000 0000000000000000 : X
crond 18 S C0106000 0 89 1 116 95 86
sig: 0 0000000000000000 0000000000000000 : X
sendmail 17 S C0106000 0 95 1 99 89
sig: 0 0000000000000000 0000000000000000 : X
httpd 8 D C01FE000 0 97 1 104 103
sig: 0 0000000000000000 0000000000000000 : X
gpm 20 S C01FE000 0 99 1 103 95
sig: 0 0000000000000000 0000000000000000 : X
rc.M 21 S C01FE000 0 103 1 115 97 99
sig: 0 0000000000000000 0000000000010000 : X
sh 5 D C0106000 0 104 1 105 97
sig: 0 0000000000000000 0000000000000000 : X
sh 19 D C0106000 0 105 1 106 104
sig: 0 0000000000000000 0000000000000000 : X
sh 22 D C0304000 0 106 1 107 105
sig: 0 0000000000000000 0000000000000000 : X
sh 23 D C0106000 0 107 1 108 106
sig: 0 0000000000000000 0000000000000000 : X
sh 24 D C0354000 0 108 1 109 107
sig: 0 0000000000000000 0000000000000000 : X
sh 25 D C0106000 0 109 1 110 108
sig: 0 0000000000000000 0000000000000000 : X
sh 26 D C029A000 0 110 1 111 109
sig: 0 0000000000000000 0000000000000000 : X
sh 27 D C01FE000 0 111 1 112 110
sig: 0 0000000000000000 0000000000000000 : X
sh 28 D C01FE000 0 112 1 114 111
sig: 0 0000000000000000 0000000000000000 : X
sh 30 D C029A000 0 114 1 112
sig: 0 0000000000000000 0000000000000000 : X
start 29 D C01FE000 0 115 103
sig: 0 0000000000000000 0000000000000000 : X
sh 31 D C01FE000 0 116 89
sig: 0 0000000000000000 0000000000000000 : X

-George

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html