[LWN Logo]

Date:	Wed, 18 Mar 1998 17:22:17 -0500 (EST)
From:	"Richard B. Johnson" <root@chaos.analogic.com>
To:	Linux kernel <linux-kernel@vger.rutgers.edu>
Subject: Linux 2.1.90 memory management trouble


Hello,
2.2.90 has some problems with memory management that makes the system
fail to use available memory and start thrashing swap.

Executing:

# make clean
# make -j zImage &>World.Log &

.... from the linux directory will result in about 3 hours of swap-file
thrashing on a 166 MHz Pentium. It is possible to get some system
information, but the time to respond to shell commands is measured in
quarter-hours so I could not get too much information.

`ps` shows that most everything is in "wait_on_page".

`cat /proc/meminfo` shows there are plenty of resources not being used.

        total:    used:    free:  shared: buffers:  cached:
Mem:  31498240 28475392  3022848 27500544   143360  8179712
Swap: 133885952 45293568 88592384
MemTotal:     30760 kB
MemFree:       2952 kB
MemShared:    26856 kB
Buffers:        140 kB
Cached:        7988 kB
SwapTotal:   130748 kB
SwapFree:     86516 kB

The compile did not complete:

gcc -D__KERNEL__ -I/usr/src/linux-2.1.90/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o vmscan.o vmscan.c
gcc -D__KERNEL__ -I/usr/src/linux-2.1.90/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o page_io.o page_io.c
gcc -D__KERNEL__ -I/usr/src/linux-2.1.90/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o page_alloc.o page_alloc.c
gcc -D__KERNEL__ -I/usr/src/linux-2.1.90/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o swap_state.o swap_state.c
gcc -D__KERNEL__ -I/usr/src/linux-2.1.90/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586   -c -o swapfile.o swapfile.c
gcc: Internal compiler error: program cc1 got fatal signal 11
make[2]: *** [swap_state.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/usr/src/linux-2.1.90/mm'
make[1]: *** [first_rule] Error 2
make[1]: Leaving directory `/usr/src/linux-2.1.90/mm'
make: *** [linuxsubdirs] Error 2

Probably cc1 didn't check a pointer when it allocated some memory so
it got a SIGSEGV writing to NULL.

System info:

CONFIG_M586=y
CONFIG_MODULES=y
CONFIG_NET=y
CONFIG_PCI=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
CONFIG_BLK_DEV_FD=y
CONFIG_PARIDE_PARPORT=y
CONFIG_PACKET=y
CONFIG_NETLINK=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_NOSR=y
CONFIG_SKB_LARGE=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_BLK_DEV_SR=y
CONFIG_SCSI_BUSLOGIC=y
CONFIG_SCSI_OMIT_FLASHPOINT=y
CONFIG_NETDEVICES=y
CONFIG_NET_ETHERNET=y
CONFIG_NET_ISA=y
CONFIG_NE2000=y
CONFIG_CDROM=y
CONFIG_EXT2_FS=y
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
CONFIG_NFSD=y
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
CONFIG_CODA_FS=y
CONFIG_NLS=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_VGA_CONSOLE=y

There seems to be some very agressive swapping going on. Even `pine` is
swapped out when I access another window!!

 FLAGS   UID   PID  PPID PRI  NI   SIZE   RSS WCHAN       STA TTY TIME COMMAND
   100     0     1     0   0   0    212    40             S   ?   0:04 init 
    40     0     2     1   0   0      0     0 bdflush     SW  ?   0:00 (kflushd)
    40     0     3     1 -12 -12      0     0             SW< ?   0:34 (kswapd)
   140     0    10     1   0   0    800    44 sigsuspend  SW  ?   0:00 update (bdflush) 
    40     0    31     1   0   0    844    80 sigsuspend  SW  ?   0:00 /usr/sbin/crond 
   140     0    47     1   0   0    284   104 do_select   SW  ?   0:00 /usr/sbin/syslogd 
100140     0    49     1   0   0    444     0             SW  ?   0:00 (klogd)
100140     1    51     1   0   0    864   236 do_select   SW  ?   0:00 /usr/sbin/rpc.portmap 
100140     0    53     1   0   0    840     0 do_select   SW  ?   0:00 (inetd)
   140     0    55     1   0   0    812   204 skb_recv_da SW  ?   0:00 /usr/sbin/rwhod -t -s 
100140     0    57     1   0   0    232     0 do_select   SW  ?   0:00 (lpd)
    40     0    59     1   0   0    884    68 do_select   SW  ?   0:00 /usr/sbin/rpc.mountd 
    40     0    61     1   0   0    912    68 do_select   SS  ?   0:00 /usr/sbin/rpc.nfsd 
100140     0    63     1   0   0    840     0 do_select   SW  ?   0:00 (rpc.pcnfsd)
   140     0    73     1  12   0   1280   328 wait_for_co SS  ?   0:00 sendmail: accepting connections                                                          
100040     0    81     1   0   0    828     0 wait_for_co SW  ?   0:00 (rmtadm)
100140     0    83     1   0   0   1356    52 do_select   S   ?   0:00 /usr/sbin/httpd 
   100     0    84     1  15   0   1168   500             SW   1  0:00 -bash 
   100     0    85     1   0   0   1168   468             SW   2  0:00 -bash 
     0     0    86     1   0   0    128     0 read_chan   SW   3  0:00 (agetty)
     0     0    87     1   0   0    128     0 read_chan   SW   4  0:00 (agetty)
     0     0    88     1   0   0    128     0 read_chan   SW   5  0:00 (agetty)
     0     0    89     1   0   0    128     0 read_chan   SW   6  0:00 (agetty)
100140   666    90    83   0   0   1356     4 do_select   S   ?   0:00 (httpd)
100100     0   803    84  17   0    356   336             R    1  0:00 ps laxw 
100100     0   781    85   0   0   2604  1388             SW   2  0:00 pine 


Cheers,
Dick Johnson
                  ***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.90 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu