From: Jens Axboe <jens.axboe@oracle.com>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: chris.mason@oracle.com, david@fromorbit.com, hch@infradead.org,
akpm@linux-foundation.org, jack@suse.cz,
yanmin_zhang@linux.intel.com, richard@rsk.demon.co.uk,
Jens Axboe <jens.axboe@oracle.com>
Subject: [PATCH 08/12] writeback: include default_backing_dev_info in writeback
Date: Tue, 26 May 2009 11:33:46 +0200 [thread overview]
Message-ID: <1243330430-9964-9-git-send-email-jens.axboe@oracle.com> (raw)
In-Reply-To: <1243330430-9964-1-git-send-email-jens.axboe@oracle.com>
We see dirty inodes there occasionally, so better be safe and write them
out.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
---
fs/fs-writeback.c | 2 +-
include/linux/writeback.h | 1 +
mm/backing-dev.c | 8 ++++++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 8e0902e..e4f96b9 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -432,7 +432,7 @@ static void wb_writeback(struct bdi_writeback *wb)
* This will be inlined in bdi_writeback_task() once we get rid of any
* dirty inodes on the default_backing_dev_info
*/
-static void wb_do_writeback(struct bdi_writeback *wb)
+void wb_do_writeback(struct bdi_writeback *wb)
{
/*
* We get here in two cases:
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index baf04a9..e414702 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -69,6 +69,7 @@ void writeback_inodes(struct writeback_control *wbc);
int inode_wait(void *);
void sync_inodes_sb(struct super_block *, int wait);
void sync_inodes(int wait);
+void wb_do_writeback(struct bdi_writeback *wb);
/* writeback.h requires fs.h; it, too, is not included from here. */
static inline void wait_on_inode(struct inode *inode)
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 57e44e3..977c171 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -396,8 +396,8 @@ static int bdi_forker_task(void *ptr)
* Temporary measure, we want to make sure we don't see
* dirty data on the default backing_dev_info
*/
- if (wb_has_dirty_io(me))
- bdi_flush_io(me->bdi);
+ if (wb_has_dirty_io(me) || !list_empty(&me->bdi->work_list))
+ wb_do_writeback(me);
prepare_to_wait(&me->wait, &wait, TASK_INTERRUPTIBLE);
@@ -424,6 +424,10 @@ static int bdi_forker_task(void *ptr)
continue;
}
+ /*
+ * This is our real job - check for pending entries in
+ * bdi_pending_list, and create the tasks that got added
+ */
bdi = list_entry(bdi_pending_list.next, struct backing_dev_info,
bdi_list);
list_del_init(&bdi->bdi_list);
--
1.6.3.rc0.1.gf800
next prev parent reply other threads:[~2009-05-26 9:33 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 9:33 [PATCH 0/12] Per-bdi writeback flusher threads v7 Jens Axboe
2009-05-26 9:33 ` [PATCH 01/12] ntfs: remove old debug check for dirty data in ntfs_put_super() Jens Axboe
2009-05-26 9:33 ` [PATCH 02/12] btrfs: properly register fs backing device Jens Axboe
2009-05-26 9:33 ` [PATCH 03/12] writeback: move dirty inodes from super_block to backing_dev_info Jens Axboe
2009-05-26 9:33 ` [PATCH 04/12] writeback: switch to per-bdi threads for flushing data Jens Axboe
2009-05-26 9:33 ` [PATCH 05/12] writeback: get rid of pdflush completely Jens Axboe
2009-05-26 9:33 ` [PATCH 06/12] writeback: separate the flushing state/task from the bdi Jens Axboe
2009-05-26 9:33 ` [PATCH 07/12] writeback: support > 1 flusher thread per bdi Jens Axboe
2009-06-04 17:44 ` Paul E. McKenney
2009-06-04 19:48 ` Jens Axboe
2009-05-26 9:33 ` Jens Axboe [this message]
2009-05-26 9:33 ` [PATCH 09/12] writeback: allow sleepy exit of default writeback task Jens Axboe
2009-05-26 9:33 ` [PATCH 10/12] writeback: add some debug inode list counters to bdi stats Jens Axboe
2009-05-26 9:33 ` [PATCH 11/12] writeback: add name to backing_dev_info Jens Axboe
2009-05-26 9:33 ` [PATCH 12/12] writeback: check for registered bdi in flusher add and inode dirty Jens Axboe
2009-05-26 15:25 ` [PATCH 0/12] Per-bdi writeback flusher threads v7 Damien Wyart
2009-05-26 16:41 ` Jens Axboe
2009-05-26 17:08 ` Damien Wyart
2009-05-26 17:10 ` Damien Wyart
2009-05-26 20:47 ` Jens Axboe
2009-05-26 21:11 ` Jens Axboe
2009-05-27 5:21 ` Damien Wyart
2009-05-27 5:49 ` Damien Wyart
2009-05-27 9:20 ` Jens Axboe
2009-05-27 13:15 ` Damien Wyart
2009-05-27 15:05 ` Jens Axboe
2009-05-27 21:06 ` Andrew Morton
2009-05-28 10:20 ` Jens Axboe
2009-05-27 6:17 ` Jens Axboe
2009-05-27 5:27 ` Zhang, Yanmin
2009-05-27 6:17 ` Jens Axboe
2009-06-02 2:07 ` Zhang, Yanmin
2009-06-02 11:53 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2009-05-25 7:34 [PATCH 0/12] Per-bdi writeback flusher threads #5 Jens Axboe
2009-05-25 7:34 ` [PATCH 08/12] writeback: include default_backing_dev_info in writeback Jens Axboe
2009-05-25 7:30 [PATCH 0/12] Per-bdi writeback flusher threads #5 Jens Axboe
2009-05-25 7:30 ` [PATCH 08/12] writeback: include default_backing_dev_info in writeback Jens Axboe
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=1243330430-9964-9-git-send-email-jens.axboe@oracle.com \
--to=jens.axboe@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=chris.mason@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@rsk.demon.co.uk \
--cc=yanmin_zhang@linux.intel.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;
as well as URLs for NNTP newsgroup(s).