Hello
On Mon, 2006-06-05 at 16:29 +0200, Juergen Starek wrote:
> Vladimir V. Saveliev schrieb:
> > On Mon, 2006-06-05 at 15:11 +0200, Juergen Starek wrote:
> >
> >> I have noticed that if I put my ~ on a ReiserFS partition, Pan (GNOME's
> >> newsreader) starts very slowly, [...]
> >
> > Probably Pan is stat(2)-ing whole cache. Can you please try to find out
> > what Pan is doing on start? Strace(1) may help.
>
> You're right, I straced Pan's start process and after initialization, it
> seems to call stat64 on every message in its cache. This is a snippet of
> the trace, produced on an ext3 filesystem (line length exceeds 80 chars):
>
> ==========
> stat64("/home/jstarek/.pan/gmane", {st_mode=S_IFDIR|0755, st_size=4096, ...})
> = 0
> stat64("/home/jstarek/.pan/Standard", {st_mode=S_IFDIR|0755, st_size=4096,
> ...}) = 0
>
> stat64("/home/jstarek/.pan/messages/cache", {st_mode=S_IFDIR|0755,
> st_size=1032192, ...}) = 0
> open("/home/jstarek/.pan/messages/cache",
> O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 6
> fstat64(6, {st_mode=S_IFDIR|0755, st_size=1032192, ...}) = 0
> fcntl64(6, F_SETFD, FD_CLOEXEC) = 0
> getdents64(6, /* 62 entries */, 4096) = 4096
> stat64("/home/jstarek/.pan/messages/cache/[EMAIL PROTECTED]",
> {st_mode=S_IFREG|0644, st_size=1426, ...}) = 0
> time(NULL) = 1149517138
> ==========
>
> The last two calls of this trace snippet are then repeated for all files
> in the cache.
>
> > If Pan is doing millions of stats for files from cache - that explains
> > why it starts slowly when cache is stored on reiserfs.
>
> Could you please explain this? An URL with the explanation is fine, too --
> I just don't have experience with file systems...
>
reiserfs does not store inodes as compact as ext3. It allocates inodes
dynamically. As result reiserfs inodes get spread over whole filesystem.
Also reiserfs tries to store file bodies in the same block as file's
inode. As result one reiserfs block usually contains inodes than ext[23]
inode block does.
So, to stat each file of directory reiserfs has to perform more disk
reads and to do more disk head seek than a filesystem which stores
inodes compactly in preallocated disk area.
> Thanks,
>
> Jürgen
>
>