Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Nov 2002 02:02:14 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Tomas Pluskal <plusik@pohoda.cz>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: seeking help to rewrite the msdos filesystem
Message-ID:  <3DD22326.74544EAF@mindspring.com>
References:  <20021113094824.N1339-100000@localhost.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
Tomas Pluskal wrote:
> > This has more to do with sequential access.  Technically, you can
> > read a FAT cluster at a time instead of an FS block at a time, and
> > you will achieve some multiplier on sequential access, but you will
> > find that under load, that the fault rate for blocks will go up.
> 
> When I read from my ZIP drive, according to iostat the request size is
> 2KB. When I run dd with 2KB request size:
> 
> # dd if=/dev/afd0 of=/dev/null bs=2048 count=100
> 100+0 records in
> 100+0 records out
> 204800 bytes transferred in 2.127448 secs (96266 bytes/sec)
> 
> If I understand this right, I can never get faster then 96KB/s with
> sequential access, when using 2KB requests ? It is quite slow :)

Uh... the way you are using it here doesn't involve MSDOSFS at
all.

What happens if you say:

# dd if=/dev/afd0 of=/dev/null bs=2048 count=100
# dd if=/dev/afd0 of=/dev/null bs=2048 count=100

Does the second one complete out of cache, and therefore faster?

# dd if=/dev/afd0 of=/dev/null bs=204800 count=1
# dd if=/dev/afd0 of=/dev/null bs=204800 count=1

Are the requests still 2K according to iostat?  If so, is it
because it's a device driver limitation, or a hardware limitation
of the ZIP disks themselves?

Does the second one complete out of cache, and therefore faster?

- I'll assume that the answers to the above questions are, in order,
  "no, no, N/A", unless you want to contradict.

Is this a SCSI ZIP disk?  The fastest possible read time you
can possibly get out of any disk is to read SCSI mode page 2,
and read a track at a time, so that you avoid track-to-track
seeks in the middle of reads, using tagged commands to interleave
requests to amortize a single seek latency across all requests
combined.

- I'll assume that the answer is "no"; basically, you will have
  to learn to live with a 1.5 times seek latency per virtual
  "fixed size track" read.

Assuming all that...

Most likely, the 2K is because that's the underlying FS block
size.

There is no optimization for sequential reads in MSDOSFS because
the block offset requires metadata access, which is going to
cause a seek, and there's no sequential optimization (see
msdosfs_bmap() in /sys/fs/msdosfs/msdosfs_vnops.c), for lack
of available metadata (without another seek and read of the FAT
table... unless it's cached; see pcbmap() in msdosfs_fat.c).

You probably want an is_sequential() to avoid really, really
pessimizing random I/O.

You should also look at the large block comment above the manifest
constants defined for fs_setcache() in denode.h; you can see that
it tries to implement the "one behind" entry I was talking about
previously, but that this doesn't really help you, so there are
either multiple opens, directory traversals, or other things going
on because of the application you are running.

Finally, note that the cache for the entire FAT, or as much of
the FAT, and it's locality asyou can afford, LRU'ed, is not
mapped. per the MACH MSDOSFS paper reference.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DD22326.74544EAF>