Re: Big bad NFS directories in 2.0.xx

Daryll Strauss (daryll@d2.com)
Fri, 5 Jun 1998 11:48:41 -0700


On Fri, Jun 05, 1998 at 11:10:56AM +0100, Alan Cox wrote:

> What is eating it - the kernel or user space. I've got 1000+ file
> directories I regulary use over NFS on 8 and 16Mbyte PC's.

It is actually ls that is growing. I ran strace on my box with the
enlarged NFS_READDIR_CACHE_SIZE, the trace looked reasonable:

open("/lot/s43/ARM/SH26/img/sh26_edge_poly.odd", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=02, st_size=897053632, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
getdents(3, /* 166 entries */, 7944) = 7920
lseek(3, 22359089, SEEK_SET) = 22359089
brk(0x120112000) = 0x120112000
brk(0x120118000) = 0x120118000
lseek(3, 0, SEEK_CUR) = 22359089
lseek(3, 0, SEEK_CUR) = 22359089
getdents(3, /* 24 entries */, 7944) = 1152
lseek(3, 0, SEEK_CUR) = 22625329
getdents(3, /* 165 entries */, 7944) = 7920
lseek(3, 73083953, SEEK_SET) = 73083953
brk(0x120124000) = 0x120124000
lseek(3, 0, SEEK_CUR) = 73083953
getdents(3, /* 24 entries */, 7944) = 1152
lseek(3, 0, SEEK_CUR) = 73350193
getdents(3, /* 165 entries */, 7944) = 7920
lseek(3, 106245169, SEEK_SET) = 106245169
brk(0x12013c000) = 0x12013c000

<<This pattern of 5 seek/getdents with an occational brk continues>>>

lseek(3, 0, SEEK_CUR) = 1845995581
getdents(3, /* 24 entries */, 7944) = 1152
lseek(3, 0, SEEK_CUR) = 1846380605
getdents(3, /* 162 entries */, 7944) = 7928
lseek(3, 18446744071989940956, SEEK_SET) = -1 EINVAL (Invalid argument)
lseek(3, 0, SEEK_CUR) = -1 EINVAL (Invalid argument)
getdents(3, /* 4 entries */, 7944) = 224
lseek(3, 0, SEEK_CUR) = -1 EINVAL (Invalid argument)
getdents(3, /* 114 entries */, 7944) = 6320
lseek(3, 0, SEEK_CUR) = -1 EINVAL (Invalid argument)
getdents(3, /* 0 entries */, 7944) = 0
close(3) = 0

With the NFS_READDIR_CACHE_SIZE set the the default of 64 I get:

open("/lot/s43/ARM/SH26/img/sh26_edge_poly.odd", O_RDONLY|O_NONBLOCK) = 3
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=02, st_size=897067588, ...}) = 0
lseek(3, 0, SEEK_CUR) = 0
getdents(3, /* 64 entries */, 7944) = 3024
brk(0x120112000) = 0x120112000
lseek(3, 0, SEEK_CUR) = 5840945
getdents(3, /* 64 entries */, 7944) = 3072

<<< This pattern of lseek/getdents with an occational brk >>>

SYS_341(0x1555556c000, 0x30000, 0x5e000, 0x1, 0xffffffffffffffff) =
14660155965\44
lseek(3, 0, SEEK_CUR) = 1488106967
getdents(3, /* 1 entries */, 7944) = 48
lseek(3, 0, SEEK_CUR) = 1488106967
getdents(3, /* 1 entries */, 7944) = 48

<<< This pattern of lseek/getdents repeats forever(?) >>>

The lseek doesn't show the pointer moving forward from this point on.

- |Daryll

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