* query related to write_mapping_buffers
@ 2002-12-03 11:26 Kapish K
2002-12-03 19:19 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Kapish K @ 2002-12-03 11:26 UTC (permalink / raw)
To: linux-fsdevel
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? in
terms of kind of data or pages and why are
both needed?
ext2_writepages calls write_mapping_buffers
first and then mpage_writepages ( my
reference is 2.5.30 )
The comment in write_mapping_buffers does
say that it writes back indirect blocks (
metadata? ), but I am not sure I get the
whole idea.
Any hints on this that might help understand
this better will be most appreciated
Thanks In Advance
________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: query related to write_mapping_buffers
2002-12-03 11:26 query related to write_mapping_buffers Kapish K
@ 2002-12-03 19:19 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2002-12-03 19:19 UTC (permalink / raw)
To: kapish; +Cc: linux-fsdevel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-03 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-03 11:26 query related to write_mapping_buffers Kapish K
2002-12-03 19:19 ` Andrew Morton
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).