On Mon, Jan 18, 2010 at 11:00:01AM -0800, Linus Torvalds wrote: > 8192 would be wonderful, but it's not what I get. First off, you need to > use "strace -f", because blkid itself is just a shell script. Or if I Sure, I don't use the libtool script, I use LD_LIBRARY_PATH. > execture lt-blkid manually, I don't hey 8kB at all, I get 17497. This is correct. The last read() (16384 bytes) is a read from FAT root directory where we look for LABEL. The size of this segment is not fixed and it depends on the directory size. Anyway, it seems that we don't have to read all FAT root directory entries, it's better to call read() for each directory entry (32 bytes) and stop at end of the directory or when we found the label. After this change: $ LD_LIBRARY_PATH=shlibs/blkid/src/.libs strace -s -T8 -e read \ ./misc-utils/.libs/blkid -O 16384 -p ~/fat12-linus.img read(3, ""..., 832) = 832 read(3, ""..., 832) = 832 read(3, ""..., 832) = 832 read(3, ""..., 1024) = 1024 read(3, ""..., 32) = 32 /home/kzak/fat12-linus.img: SEC_TYPE="msdos" VERSION="FAT12" TYPE="vfat" USAGE="filesystem" It means 1056 bytes for your disk image! Looks like a nice improvement ;-) The change is pushed to the repository, so "git pull" is your friend. > and I have _no_ idea why that close() takes so long, but I'm guessing that > it is flushing the page cache and has to wait for any read-ahead to > finish. hmm.. I think application should not be affected by read-ahead. > That is arguably a kernel problem, and I'll take a look at it. Although > disabling read-ahead in blkid is probably a good thing regardless. Applied, thanks for the patch. > However, the real problem is that you didn't fix the whole-disk case: Yes, ignore this problem for now. The ideal solution is not to call blkid for the whole disk. We have to resolve this problem. I have also restricted some filesystems (but still need to found minimal sizes for UFS and UDF). BTW, you can try "export BLKID_DEBUG=0xffff" to see more details about probing. Karel -- Karel Zak <kzak@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html