From: Andrew Morton <akpm@digeo.com>
To: kapish@ureach.com
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: query related to write_mapping_buffers
Date: Tue, 03 Dec 2002 11:19:25 -0800 [thread overview]
Message-ID: <3DED03BD.B572A942@digeo.com> (raw)
In-Reply-To: 200212031126.GAA04431@www22.ureach.com
Kapish K wrote:
>
> Hello,
> I have tried to understand this part, and
> must confess I haven't been able to get a
> clear idea of the logic/reasoning behind this.
> What does write_mapping_buffers and
> mpage_writepages attempt to write out?
Consider the case of writing a single large ext2 file.
Ideally, it will be laid out on disk as 1024 data blocks
then one indirect block, then 1024 data blocks then one
indirect block, etc.
We want to send them to disk in that order to avoid any
unnecessary seeking.
That happens naturally in the 2.4 kernel because writeout
occurs against the dirty block LRU - blocks are sent to disk in
the order in which they were dirtied.
But in 2.5, writeout occurs on a per-inode basis. And the
file data are in a different inode from the indirect blocks.
The idea was that write_mapping_buffers() would submit the
indirect blocks for writes, and mpage_writepages() would
submit the data and they would get merged nicely together
at the disk request layer.
It worked OK for most things, but didn't work right for
really large files. So write_mapping_buffers() was removed
in a later kernel. Now, mpage_writepage() will use the
`buffer_boundary()' IO scheduling hint to determine that
a data block probably has a neighbouring dirty metadata
block. It will call write_boundary_block() at the appropriate
time to try to locate that block, and start IO against it.
Net effect: the indirect blocks and data blocks are all smoothly
and linearly sent to disk.
It's a bit awkward - that natural scheduling of IO against different
inodes is something we lost when the global buffer LRU was removed.
prev parent reply other threads:[~2002-12-03 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 11:26 query related to write_mapping_buffers Kapish K
2002-12-03 19:19 ` Andrew Morton [this message]
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=3DED03BD.B572A942@digeo.com \
--to=akpm@digeo.com \
--cc=kapish@ureach.com \
--cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).