Re: [showstopper] Memory leak in 2.2.1

Oleg Drokin (green@ccssu.crimea.ua)
Tue, 2 Feb 1999 20:15:48 +0300 (MSK)


Hello!

> > There is nasty memory leak in 2.2.1. Looks like it is in VFS.
> > I have 4G partition, with a lot of files on it (squid cache)
> > Whenever I try to copy it to another one, copying never finishes
> > buffers and cached gets lower and lower (64M RAM), and finally
> > I get messages like "no memory for bash" etc. Kernel is alive,
> > but system is dead.
> > 100% reproducable. 2.0.36 is fine
> > Hope that helps.
>
> Not really. What filesystem you are using? How does 2.1.130 behave
ext2fs. 2.1.130 behaves absolutely the same way.

> (release prior to the latest VFS changes)? What about alt-sysrq? What
alt-sysrq works almost as expected (a-s-r however doesnot result in clean
fs on boot, however)
> kind of buffers breeds? If you can cat /proc/slabinfo in process it would
> give some idea on WTF happens. Please, give more details.
So I booted 2.2.1 in single user and tried to record some stats (2.1.130 is
the same, so I'm not going to show it stats here):

free output and slabinfo before starting copy:
total used free shared buffers cached
Mem: 63528 4052 59476 1148 2084 968
-/+ buffers/cache: 1000 62528
Swap: 104384 0 104384

slabinfo - version: 1.0
kmem_cache 28 42
tcp_tw_bucket 0 0
tcp_bind_bucket 0 0
tcp_open_request 0 0
skbuff_head_cache 0 0
sock 3 11
dquot 0 0
filp 16 42
signal_queue 0 0
buffer_head 2116 2142
mm_struct 3 31
vm_area_struct 34 63
dentry_cache 57 62
files_cache 2 14
uid_cache 0 0
size-131072 0 0
size-65536 0 0
size-32768 0 0
size-16384 0 0
size-8192 0 0
size-4096 2 2
size-2048 4 4
size-1024 2 8
size-512 16 16
size-256 11 14
size-128 262 275
size-64 56 84
size-32 84 126
slab_cache 5 63

free output right after memory fills with cache

total used free shared buffers cached
Mem: 63528 62860 668 656 20392 38852
-/+ buffers/cache: 3616 59912
Swap: 104384 216 104168

free output, slabinfo and "ps axl" in the middle of copy:

total used free shared buffers cached
Mem: 63528 62368 1160 804 6684 14620
-/+ buffers/cache: 41064 22464
Swap: 104384 212 104172

slabinfo - version: 1.0
kmem_cache 28 42
tcp_tw_bucket 0 0
tcp_bind_bucket 0 0
tcp_open_request 0 0
skbuff_head_cache 0 0
sock 3 11
dquot 0 0
filp 32 42
signal_queue 0 0
buffer_head 6244 6552
mm_struct 4 31
vm_area_struct 45 63
dentry_cache 47 93
files_cache 3 14
uid_cache 0 0
size-131072 0 0
size-65536 0 0
size-32768 0 0
size-16384 0 0
size-8192 0 0
size-4096 2 2
size-2048 5 8
size-1024 2 8
size-512 16 16
size-256 11 14
size-128 262 275
size-64 56 84
size-32 88 126
slab_cache 6 63

FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
100 0 1 0 0 0 1148 0 c0115fb1 SW ? 0:03 (bash)
40 0 2 1 0 0 0 0 c0125be5 SW ? 0:00 (kflushd)
840 0 3 1 0 0 0 0 c011fad6 SW ? 0:00 (kswapd)
100 0 7 1 13 0 1144 448 c0115fb1 S ? 0:00 bash
100 0 13 1 11 0 7092 5276 c011b185 D ? 0:33 cp -a /us
0 0 131 7 14 0 888 364 0 R ? 0:00 ps axl

free output, slabinfo and "ps axl" in the when I decided to stop copy:

total used free shared buffers cached
Mem: 63528 55940 7588 888 1336 3876
-/+ buffers/cache: 50728 12800
Swap: 104384 200 104184

slabinfo - version: 1.0
kmem_cache 28 42
tcp_tw_bucket 0 0
tcp_bind_bucket 0 0
tcp_open_request 0 0
skbuff_head_cache 0 0
sock 3 11
dquot 0 0
filp 32 42
signal_queue 0 0
buffer_head 1372 2016
mm_struct 3 31
vm_area_struct 34 63
dentry_cache 41 62
files_cache 2 14
uid_cache 0 0
size-131072 0 0
size-65536 0 0
size-32768 0 0
size-16384 0 0
size-8192 0 0
size-4096 3 4
size-2048 4 8
size-1024 2 8
size-512 17 24
size-256 11 14
size-128 262 275
size-64 57 84
size-32 87 126
slab_cache 8 63

FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND
100 0 1 0 0 0 1148 348 c0186552 S ? 0:03 init
40 0 2 1 0 0 0 0 c0125be5 SW ? 0:01 (kflushd)
840 0 3 1 1 0 0 0 c011fad6 SW ? 0:01 (kswapd)
100 0 7 1 19 0 1148 428 c0115fb1 S ? 0:00 bash
0 0 171 7 19 0 888 364 0 R ? 0:00 ps axl

free output and slabinfo after umount of target and remount ro source fs:

total used free shared buffers cached
Mem: 63528 61912 1616 972 7820 2764
-/+ buffers/cache: 51328 12200
Swap: 104384 156 104228

slabinfo - version: 1.0
kmem_cache 28 42
tcp_tw_bucket 0 0
tcp_bind_bucket 0 0
tcp_open_request 0 0
skbuff_head_cache 0 0
sock 3 11
dquot 0 0
filp 32 42
signal_queue 0 0
buffer_head 7848 8316
mm_struct 3 31
vm_area_struct 34 63
dentry_cache 50 62
files_cache 2 14
uid_cache 0 0
size-131072 0 0
size-65536 0 0
size-32768 0 0
size-16384 0 0
size-8192 0 0
size-4096 3 4
size-2048 4 4
size-1024 2 8
size-512 17 24
size-256 11 14
size-128 261 275
size-64 56 84
size-32 84 126
slab_cache 7 63

What else can I do?
BTW, Andrea Arcangeli told me to use his ikd patch, but given URL was wrong, so
I cannot provide such info for now. Will it be useful?

Bye,
Oleg

-- 
 [RAVE *SUCKS* TEAM] [Team $Ui(iDE] [Trans-M Must Die!] [Sepultura Fans Team]
                         [Tolkien forever team]

- 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.tux.org/lkml/