Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Oct 2007 04:48:20 +0400
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        freebsd-fs@freebsd.org
Subject:   Very slow writes on flash + msdosfs
Message-ID:  <20071005004820.GA29814@hades.panopticon>

next in thread | raw e-mail | index | archive | help
Hi!

I have USB flash:

da0 at umass-sim0 bus 0 target 0 lun 0
da0: <JetFlash TS2GJF150 8.07> Removable Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 1999MB (4095998 512 byte sectors: 255H 63S/T 254C)

It attaches to ehci and I get pretty good read/write speed:

% dd if=/dev/zero of=/dev/da0 bs=1m 
dd: /dev/da0: short write on character device
dd: /dev/da0: end of device
2000+0 records in
1999+1 records out
2097150976 bytes transferred in 178.132363 secs (11772993 bytes/sec)

% dd if=/dev/da0 of=/dev/zero bs=1m count=100
100+0 records in
100+0 records out
104857600 bytes transferred in 7.240738 secs (14481618 bytes/sec)

But newfs_msdos ran on it is very slow:

% time newfs_msdos -F32 -LAMDmi3 -k 0xffff /dev/da0s1 
/dev/da0s1: 4072456 sectors in 509057 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf0 spt=63 hds=255 hid=0 bsec=4080447 bspf=3978 rdcl=2 infs=1 bkbs=0xffff
newfs_msdos -F32 -LAMDmi3 -k 0xffff /dev/da0s1  0,02s user 0,21s system 0% cpu 2:54,37 total

when it runs, gkrellm shows 23kb/s writes.

Writing a 1.0Mb directory with 340 files takes 1.5 minutes (up to 300k/sec
writes => seems like much more data is actually written that it's
needed).

Larger files behave somewhat better (up to 3 MB/s).

Btw, dd if=/dev/zero of=/dev/da0 bs=512 show the same 23k/s speed as
newfs_msdosfs.

So where is the problem? Why's there no caching and why's there 1 sector
writes?

PS. I use 6.1, has the situation changed in -CURRENT?

-- 
Best regards,
  Dmitry Marakasov               mailto:amdmi3@amdmi3.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071005004820.GA29814>