All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: Frantisek Rysanek <Frantisek.Rysanek@post.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [noob q. on block layer] block IO read-ahead during sequential *write*?
Date: Mon, 7 Jan 2008 13:49:52 +0100	[thread overview]
Message-ID: <20080107124952.GA8201@lazybastard.org> (raw)
In-Reply-To: <47822835.4182.1ADF8AE7@localhost>

On Mon, 7 January 2008 13:25:09 +0100, Frantisek Rysanek wrote:
> 
> let me start with a simple example. The following commands:
> 
>  cp /dev/zero /dev/hda
>  dd if=/dev/zero of=/dev/hda [bs=512]
> 
> both have one common side-effect: apart from the disk being properly 
> overwritten with zeroes, the kernel seems to keep reading sectors 
> ahead of the current seek position of the sequential write.

Block devices are cached in the page cache.  If you write less than a
full page, any remainder has to be read from the device.

If you retry the dd with bs=4096 (or whatever your architecture's page
size happens to be), does this still occur?

Jörn

-- 
Chance favors only the prepared mind.
-- Louis Pasteur

  reply	other threads:[~2008-01-07 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 12:25 [noob q. on block layer] block IO read-ahead during sequential *write*? Frantisek Rysanek
2008-01-07 12:49 ` Jörn Engel [this message]
2008-01-07 15:51   ` Frantisek Rysanek

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=20080107124952.GA8201@lazybastard.org \
    --to=joern@logfs.org \
    --cc=Frantisek.Rysanek@post.cz \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.