From: Ted Ts'o <tytso@mit.edu>
To: Josef Bacik <josef@redhat.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH,RFC 1/7] ext4: fold __mpage_da_writepage() into write_cache_pages_da()
Date: Sun, 13 Feb 2011 00:42:35 -0500 [thread overview]
Message-ID: <20110213054235.GD2598@thunk.org> (raw)
In-Reply-To: <20110213012528.GD19533@dhcp231-156.rdu.redhat.com>
On Sat, Feb 12, 2011 at 08:25:29PM -0500, Josef Bacik wrote:
> > +out:
> > + pagevec_release(&pvec);
> > + cond_resched();
> > + return ret;
> > }
>
> Do we really need the cond_resched() here? Seems like it will just add
> unwanted/uneeded latencies.
The cond_resched is from the original write_cache_pages(), and if you
follow the code movement, it goes all the way back to fs/mpage.c's
__mpage_writepages() from 2.6.11 (the beginning of time as far as the
Linux 2.6's git repository is concerned).
The basic idea is that given that writeback threads are basically
running in a tight loop trying to push out dirty pages, you need to
eventually give other processes a chance to run --- especially on a UP
system! I do wonder whether we are checking way too much, though.
The cond_resched() I'd be tempted to take out is not the one at the
end of the function, but the one at the end of the while loop.
That would allow us to complete the the writeback for a particular
inode before letting another process run, which would trade off
efficiency for a bit more scheduling unfairness. But given that a
particular writeback call is capped at writing out a relatively small
mount of data anyway, that would seem to be OK.
But even XFS has a cond_resched in xfs_cluster_write() (in
fs/xfs/linux-2.6/xfs_aops.c) so I'd want to do a lot of thinking,
testing, and benchmarking before removing that call to cond_resched().
- Ted
next prev parent reply other threads:[~2011-02-13 5:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-13 0:15 [PATCH,RFC 0/7] Simplify buffered write submissions, part II Theodore Ts'o
2011-02-13 0:15 ` [PATCH,RFC 1/7] ext4: fold __mpage_da_writepage() into write_cache_pages_da() Theodore Ts'o
2011-02-13 1:25 ` Josef Bacik
2011-02-13 5:42 ` Ted Ts'o [this message]
2011-02-13 12:48 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 2/7] ext4: simple cleanups to write_cache_pages_da() Theodore Ts'o
2011-02-13 1:31 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 3/7] ext4: clear the dirty bit for a page in writeback at the last minute Theodore Ts'o
2011-02-13 1:34 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 4/7] ext4: remove page_skipped hackery in ext4_da_writepages() Theodore Ts'o
2011-02-13 1:36 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 5/7] ext4: don't lock the next page in write_cache_pages if not needed Theodore Ts'o
2011-02-13 1:38 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 6/7] ext4: move setup of the mpd structure to write_cache_pages_da() Theodore Ts'o
2011-02-13 1:40 ` Josef Bacik
2011-02-13 0:15 ` [PATCH,RFC 7/7] ext4: move ext4_journal_start/stop to mpage_da_map_and_submit() Theodore Ts'o
2011-02-18 4:23 ` Ted Ts'o
2011-02-18 10:42 ` Amir Goldstein
2011-02-18 11:44 ` Yongqiang Yang
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=20110213054235.GD2598@thunk.org \
--to=tytso@mit.edu \
--cc=josef@redhat.com \
--cc=linux-ext4@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).