From: David Chinner <dgc@sgi.com>
To: Hans Reiser <reiser@namesys.com>, Andrew Morton <akpm@osdl.org>,
"Vladimir V. Saveliev" <vs@namesys.com>,
hch@infradead.org, Reiserfs-Dev@namesys.com,
Linux-Kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: batched write
Date: Tue, 20 Jun 2006 10:01:33 +1000 [thread overview]
Message-ID: <20060620000133.GB8770394@melbourne.sgi.com> (raw)
In-Reply-To: <20060619185049.GH5817@schatzie.adilger.int>
On Mon, Jun 19, 2006 at 12:50:49PM -0600, Andreas Dilger wrote:
> On Jun 19, 2006 09:51 -0700, Hans Reiser wrote:
> > Andreas Dilger wrote:
> > >With the caveat that I didn't see the original patch, if this can be a step
> > >down the road toward supporting delayed allocation at the VFS level then
> > >I'm all for such changes.
> >
> > What do you mean by supporting delayed allocation at the VFS level? Do
> > you mean calling to the FS or maybe just not stepping on the FS's toes
> > so much or? Delayed allocation is very fs specific in so far as I can
> > imagine it.
>
> Currently the VM/VFS call into the filesystem in ->prepare_write for each
> page to do block allocation for the filesystem. This is the filesystem's
> chance to return -ENOSPC, etc, because after that point the dirty pages
> are written asynchronously and there is no guarantee that the application
> will even be around when they are finally written to disk.
>
> If the VFS supported delayed allocation it would call into the filesystem
> on a per-sys_write basis to allow the filesystem to RESERVE space for all
> of the pages in the write call,
The VFS doesn't need to support delalloc as delalloc is fundamentally a
filesystem property. The VFS it already provides a hook for delalloc space
reservation that can return ENOSPC - it's called ->prepare_write().
Sure, a batch interface would be nice, but that's an optimisation that
needs to be done regardless of whether the filesystem supports delalloc or
not. The current ->prepare_write() interface shows its limits when having to
do hundreds of thousands (millions, even) of ->prepare_write() calls per
second. This makes for entertaining scaling problems that batching would
make less of a problem.
> and then later (under memory pressure,
> page aging, or even "pull" from the fs) submit a whole batch of contiguous
> pages to the fs efficiently (via ->fill_pages() or whatever).
Can be done right now - XFS does this probe-and-pull operation already for
writes. See xfs_probe_cluster(), xfs_cluster_write() and friends.
Yes, it would be nice to have the VM pass us clusters of adjacent pages, but
given that the file layout drives the cluster size it is more appropriate
to do this from the filesystem. Also, the pages do not contain the state
necessary for the VM to cluster pages in an way that results in efficient
I/O patterns.
Basically, the only thing really needed from the VFS/VM is a method of tagging
delalloc (or unwritten) pages so that the writepage path knows how to treat
the page being written. Currently we keep that state in bufferheads (e.g. see
buffer_delay() usage) attached to the page......
> The fs can know at that time the final file size (if the file isn't still
> being dirtied), can allocate all these blocks in a contiguous chunk, can
> submit all of the IO in a single bio to the block layer or RPC/RDMA to net.
You don't need to know the final file size - just what is contiguous in the
page cache and in the same state as the page being flushed.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2006-06-20 0:02 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-23 20:14 [PATCH] updated reiser4 - reduced cpu usage for writes by writing more than 4k at a time (has implications for generic write code and eventually for the IO layer) Hans Reiser
2006-05-23 20:26 ` Alexey Polyakov
2006-05-23 20:33 ` Michal Piotrowski
2006-05-24 14:39 ` Vladimir V. Saveliev
2006-06-08 10:45 ` Jan Engelhardt
2006-06-08 12:40 ` Vladimir V. Saveliev
2006-06-08 14:11 ` Jan Engelhardt
2006-05-24 17:53 ` Tom Vier
2006-05-24 17:55 ` Hans Reiser
2006-06-08 11:00 ` Jens Axboe
2006-06-08 11:26 ` Vladimir V. Saveliev
2006-06-08 11:35 ` Jens Axboe
2006-06-08 12:08 ` Vladimir V. Saveliev
2006-06-14 19:37 ` Hans Reiser
2006-06-08 12:10 ` Christoph Hellwig
2006-06-14 22:08 ` batched write Vladimir V. Saveliev
2006-06-17 17:04 ` Andrew Morton
2006-06-17 17:51 ` Hans Reiser
2006-06-18 11:20 ` Nix
2006-06-19 9:05 ` Hans Reiser
2006-06-19 11:32 ` Miklos Szeredi
2006-06-19 16:39 ` Hans Reiser
2006-06-19 17:35 ` Miklos Szeredi
2006-06-19 17:52 ` Akshat Aranya
2006-06-19 20:39 ` Hans Reiser
2006-06-19 16:27 ` Andreas Dilger
2006-06-19 16:51 ` Hans Reiser
2006-06-19 18:50 ` Andreas Dilger
2006-06-19 20:47 ` Hans Reiser
2006-06-20 0:01 ` David Chinner [this message]
2006-06-20 7:19 ` Hans Reiser
2006-06-20 7:26 ` Andrew Morton
2006-06-20 9:02 ` Steven Whitehouse
2006-06-20 16:26 ` Vladimir V. Saveliev
2006-06-20 17:29 ` Hans Reiser
2006-06-19 18:28 ` Vladimir V. Saveliev
2006-05-24 17:59 ` [PATCH] updated reiser4 - reduced cpu usage for writes by writing more than 4k at a time (has implications for generic write code and eventually for the IO layer) Hans Reiser
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=20060620000133.GB8770394@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=Linux-Kernel@vger.kernel.org \
--cc=Reiserfs-Dev@namesys.com \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=reiser@namesys.com \
--cc=vs@namesys.com \
/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
all inboxes | Powered by JetHome®