Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 2002 12:54:48 -0500 (EST)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        Peter Edwards <peter.edwards@openet-telecom.com>, "Brian T.Schellenberger" <bts@babbleon.org>, Lars Eggert <larse@ISI.EDU>, "Rogier R. Mulhuijzen" <drwilco@drwilco.net>, Julian Elischer <julian@elischer.org>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: A weird disk behaviour
Message-ID:  <Pine.SOL.4.21.0203061252180.6633-100000@onyx>
In-Reply-To: <20020306192418.G14052@straylight.oblivion.bg>

next in thread | previous in thread | raw e-mail | index | archive | help


On Wed, 6 Mar 2002, Peter Pentchev wrote:

> On Wed, Mar 06, 2002 at 12:12:44PM -0500, Zhihui Zhang wrote:
> > 
> > 
> > On Wed, 6 Mar 2002, Peter Edwards wrote:
> > 
> > > Zhihui Zhang wrote:
> > > 
> > > <snip>
> > > 
> > > > ... I also do not read anything during the partial block write,
> > > > and I think the disk controller should not do that either.
> > > 
> > > If you do a partial block write, surely at some point the block must be read
> > > in order to preserve that segment of data you are _not_ overwriting?
> > 
> > First off, I am not writing through any file system. I access the raw
> > device directly.  Secondly, the bytes written are always a multiple of 512
> > bytes. If one sector is the I/O unit of a disk controller, why should it
> > read anything to prevent overwritten?
> 
> I think Peter was referring to the (more common IMHO) case when one sector
> was not quite the I/O unit of the disk controller, especially WRT caching.
> That is, the disk controller does not actually do a physical disk write
> for each and every sector, but only in larger blocks.

This makes sense. So you are saying that the read-modify-write cycle
actually happens within the disk controller? If so, I would love to know
the unit of the disk controller I/O to avoid it!

-Zhihui


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0203061252180.6633-100000>