public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bodo Eggert <7eggert@gmx.de>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	DervishD <lkml@dervishd.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Juergen Beisert <juergen127@kreuzholzen.de>,
	linux-kernel@vger.kernel.org
Subject: Re: Wrong free clusters count on FAT32
Date: Sun, 22 Apr 2007 19:21:04 +0200	[thread overview]
Message-ID: <E1Hffkv-0001QP-3C@be1.lrz> (raw)
In-Reply-To: 8cITG-40H-5@gated-at.bofh.it

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
> DervishD <lkml@dervishd.net> writes:

>>     Probably it's stupid to update the free clusters count at mount time
>> (sorry if so...) but it looks like a good idea to me. And of course, I
>> don't mean to update the value _on disk_, but the kernel's idea of free
>> clusters (so even FAT filesystems mounted R/O will report correct
>> values).
> 
> It would add the limitation to following simple usage,
> 
> # mount -t vfat /dev/sda1 /mnt
>         # cp -a * /mnt
>         # umount
> 
> if /dev/sda1 was the large and slow device, "mount" will need several
> minutes to counts free clusters. I think the user will be hard to
> accept the several minutes at "mount".

I simulated recalculating the FAT using a suboptimal perl script on my
32 GB FAT32 partition on a 40 GB drive. The results should show the worst
case for my system.

The results were below 2 seconds (optimized perl at 0.5 s) on my AMD Athlon
XP 2400+. (BTW: I don't think the device speed itself will be relevant in
many cases even if you'd asume a slow link, since you'll need to read the
FAT anyway.)

I think this is acceptable, and on this system, I'd like to enable
recalculating by default. On slower systems, you'll need to chose another
default.

I think you'll want that option as a module parameter to make all users happy.
And while you're at it, fmask and dmask are good candidates for module
parameters, too.-)


# echo 3 > /proc/sys/vm/drop_caches

# /usr/bin/time sh -c "dd if=/dev/hda2 bs=$((77834925/64)) count=4 | perl -e
'"'use POSIX;while (sysread STDIN,$x,4) {$n++ if $x eq "\0\0\0\0"} print
$n*32,"\n"'\'
4+0 records in
4+0 records out
13954720
0.76user 0.60system 0:01.95elapsed 69%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (8major+1583minor)pagefaults 0swaps

# /usr/bin/time sh -c "dd if=/dev/hda2 bs=$((77834925/64)) count=4 | perl -e
'"'use POSIX;while (sysread STDIN,$x,4) {$n++ if $x eq "\0\0\0\0"} print
$n*32,"\n"'\'
4+0 records in
4+0 records out
13955392
0.74user 0.69system 0:01.50elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+1591minor)pagefaults 0swaps

# /usr/bin/time sh -c "dd if=/dev/hda2 bs=$((77834925/64)) count=4 | perl -e
'"'use POSIX;while (sysread STDIN,$x,4096) {for (unpack "L*",$x){$n++ if !$_}}
print $n*32,"\n"'\'
4+0 records in
4+0 records out
13955392
0.43user 0.06system 0:00.50elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+1599minor)pagefaults 0swaps


-- 
The worse the weather, the more you are required to be out in it. 

Friß, Spammer: fv@upXs.7eggert.dyndns.org z@Z1rk.7eggert.dyndns.org
 VRo@Gb2b4rxc.7eggert.dyndns.org LimmgYHv@smpZsGtB.7eggert.dyndns.org

  parent reply	other threads:[~2007-04-22 18:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8bAF0-3Yj-29@gated-at.bofh.it>
     [not found] ` <8bDta-8rc-31@gated-at.bofh.it>
     [not found]   ` <8bFEr-3B4-1@gated-at.bofh.it>
     [not found]     ` <8cwz8-2fE-13@gated-at.bofh.it>
2007-04-22 13:28       ` Wrong free clusters count on FAT32 Bodo Eggert
2007-04-22 14:04         ` OGAWA Hirofumi
2007-04-22 14:29           ` OGAWA Hirofumi
2007-04-22 14:53             ` Andreas Schwab
2007-04-22 15:13               ` OGAWA Hirofumi
2007-04-22 21:46           ` Bodo Eggert
2007-04-23  2:20             ` OGAWA Hirofumi
2007-04-22 20:11         ` DervishD
     [not found]       ` <8cAMl-du-3@gated-at.bofh.it>
     [not found]         ` <8cBS7-1Qa-1@gated-at.bofh.it>
     [not found]           ` <8cIqE-3qZ-9@gated-at.bofh.it>
     [not found]             ` <8cITG-40H-5@gated-at.bofh.it>
2007-04-22 17:21               ` Bodo Eggert [this message]
2007-04-22 17:44                 ` OGAWA Hirofumi
2007-04-19  8:57 DervishD
2007-04-19 10:27 ` Boaz Harrosh
2007-04-19 14:23   ` DervishD
2007-04-19 11:52 ` Juergen Beisert
2007-04-19 14:19   ` DervishD
2007-04-21 22:42     ` OGAWA Hirofumi
2007-04-22  3:18       ` Andrew Morton
2007-04-22  4:26         ` OGAWA Hirofumi
2007-04-22 11:26           ` DervishD
2007-04-22 11:55             ` OGAWA Hirofumi
2007-04-22 20:08               ` DervishD
2007-04-23  2:27                 ` OGAWA Hirofumi
2007-04-23  6:19                   ` DervishD
2007-04-22 11:17       ` DervishD
2007-04-22 11:28       ` Juergen Beisert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Hffkv-0001QP-3C@be1.lrz \
    --to=7eggert@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=juergen127@kreuzholzen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@dervishd.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox