Le 22.03.2006 20:04, Hans Reiser a écrit : > Instead of using sync, could you increase the size of the files you > write so that they are 10x ram size? > > I have a suspicion we are slow at sync.... I am not sure why, but I > have seen other data where sync was slow for us, and maybe we need to > optimize that code path. > > Hans >
Hello Hans, sorry for the long delay to reply. I'm not sure this is a problem with _sync_. I had concerns with sync on reiser4, but I was thinking it was related with the FS policy which try to do a lot of work in memory, and when syncing time comes, there is a huge amount of data to write back to disk. Well, I'm not a File Systems Expert, this is wild guess... Anyway, I didn't try to "write a file of size 10x ram size". My test case is a 925M FS with 100M free, and I have 512M ram. And I guess there is a problem with the Reiser4 internal data. It's an old FS, I made thousands of kernel builds on it. I allocated a new logical volume (about same size, same HD), made it a reiser4 FS and copied all my data on it. > [EMAIL PROTECTED] ~]# grep reiser4 /proc/mounts > /dev/hda8 /home/laurent/kernel reiser4 > rw,nosuid,nodev,atom_max_size=0x7e22,atom_max_age=0x249f0,atom_min_size=0x100,atom_max_flushers=0x1,cbk_cache_slots=0x10 > 0 0 > /dev/vglinux1/test /mnt/disk reiser4 > rw,atom_max_size=0x7e22,atom_max_age=0x249f0,atom_min_size=0x100,atom_max_flushers=0x1,cbk_cache_slots=0x10 > 0 0 > [EMAIL PROTECTED] ~]# grep -e hda8 -e dm-5 /proc/partitions > 3 8 995998 hda8 > 254 5 1003520 dm-5 > [EMAIL PROTECTED] ~]# cp -pRL /home/laurent/kernel/. /mnt/disk [cut errors with symbolic links] > [EMAIL PROTECTED] ~]# df /home/laurent/kernel /mnt/disk > Sys. de fich. Tail. Occ. Disp. %Occ. Monté sur > /dev/hda8 925M 822M 103M 89% /home/laurent/kernel > /dev/mapper/vglinux1-test > 932M 800M 132M 86% /mnt/disk These FS are quite similars. Now guess what ? I filled these FS with dd. Original FS =========== # sync # time dd if=/dev/zero of=toto bs=1M count=150 103+0 enregistrements lus. 102+0 enregistrements écrits. Command exited with non-zero status 1 0.00user 2.94system 3:32.18elapsed 1%CPU (0avgtext+0avgdata 0maxresident)k # time sync 0inputs+0outputs (0major+279minor)pagefaults 0swaps 0.00user 0.01system 0:00.18elapsed 6%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+191minor)pagefaults 0swaps Copy FS ======= # sync # time dd if=/dev/zero of=toto bs=1M count=150 dd: écriture de `toto': Aucun espace disponible sur le périphérique 132+0 enregistrements lus. 131+0 enregistrements écrits. Command exited with non-zero status 1 0.00user 4.08system 0:15.95elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (1major+279minor)pagefaults 0swaps # time sync 0.00user 0.00system 0:00.17elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+190minor)pagefaults 0swaps disk$ See ? 3'30" versus 16". I packed the metadata of my original FS to a file, you can grab it from http://laurent.riffard.free.fr/kernel.reiser4.bz2 (6.7M). Note I was unable to unpack it : > # bunzip2 -c /tmp/kernel.reiser4.bz2 | debugfs.reiser4 -U /dev/vglinux1/test > debugfs.reiser4 1.0.5 > Copyright (C) 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by > reiser4progs/COPYING. > > Info : The metadata were packed with the reiser4progs 1.0.5. > > > Error: Can't unpack filesystem. ~~ laurent