Re: O_DIRECT leaks memory on linux-2.6.0-test9

From: IWAMOTO Toshihiro
Date: Fri Nov 21 2003 - 02:35:12 EST


At Thu, 20 Nov 2003 23:17:49 -0800,
Andrew Morton wrote:
>
> IWAMOTO Toshihiro <iwamoto@xxxxxxxxxxxxx> wrote:
> >
> > recently I noticed that direct IO causes memory leaks with
> > linux-2.6.0-test9.
> > The program that causes memory leaks is "fsstress", which is
> > testcases/kernel/fs/fsstress in ltp-full-20031106.tgz (ftp from
> > http://sourceforge.net/projects/ltp/).
> >
> > fsstress does various file operations, and I found that the problem is
> > with the combination of write and dread (O_DIRECT read).
> > You should be able to reproduce the bug with the following command
> > line.
> >
> > $ while true; do ./fsstress -c -d /usr/src/test -z -f write=1 \
> > -f dread=1 -f creat=1 -S -n 1000 -p 32; done
>
> It seems OK here. Please take a copy of /proc/meminfo and /proc/slabinfo.

It'll take a while to leak a noticable amount of memory. So I reduced
the amount of memory using a boot option.
I'll try the same test on another machine.

Here they are. slabinfo is in the attachment.

$ cat /proc/meminfo
MemTotal: 254592 kB
MemFree: 3952 kB
Buffers: 688 kB
Cached: 6184 kB
SwapCached: 2512 kB
Active: 8616 kB
Inactive: 212056 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 254592 kB
LowFree: 3952 kB
SwapTotal: 2097136 kB
SwapFree: 2090436 kB
Dirty: 0 kB
Writeback: 0 kB
Mapped: 4924 kB
Slab: 15200 kB
Committed_AS: 20580 kB
PageTables: 344 kB
VmallocTotal: 770040 kB
VmallocUsed: 9460 kB
VmallocChunk: 760580 kB

Attachment: slabinfo.gz
Description: Binary data