lkml.org 
[lkml]   [2008]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [noob q. on block layer] block IO read-ahead during sequential *write*?
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-01-07 13:59    [W:0.053 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site