* [PATCH 1/2] writeback: integrated background writeback work [not found] ` <20100914124033.GA4874@quack.suse.cz> @ 2010-11-01 12:14 ` Wu Fengguang 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang 2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig 0 siblings, 2 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-01 12:14 UTC (permalink / raw) To: Andrew Morton, Jan Kara Cc: linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel From: Jan Kara <jack@suse.cz> Check whether background writeback is needed after finishing each work. When bdi flusher thread finishes doing some work check whether any kind of background writeback needs to be done (either because dirty_background_ratio is exceeded or because we need to start flushing old inodes). If so, just do background write back. This way, bdi_start_background_writeback() just needs to wake up the flusher thread. It will do background writeback as soon as there is no other work. This is a preparatory patch for the next patch which stops background writeback as soon as there is other work to do. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> --- fs/fs-writeback.c | 61 +++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 15 deletions(-) --- linux-next.orig/fs/fs-writeback.c 2010-10-31 19:03:58.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-11-01 19:31:54.000000000 +0800 @@ -79,13 +79,9 @@ static inline struct backing_dev_info *i return sb->s_bdi; } -static void bdi_queue_work(struct backing_dev_info *bdi, - struct wb_writeback_work *work) +/* Wakeup flusher thread or forker thread to fork it. Requires bdi->wb_lock. */ +static void _bdi_wakeup_flusher(struct backing_dev_info *bdi) { - trace_writeback_queue(bdi, work); - - spin_lock_bh(&bdi->wb_lock); - list_add_tail(&work->list, &bdi->work_list); if (bdi->wb.task) { wake_up_process(bdi->wb.task); } else { @@ -93,15 +89,26 @@ static void bdi_queue_work(struct backin * The bdi thread isn't there, wake up the forker thread which * will create and run it. */ - trace_writeback_nothread(bdi, work); wake_up_process(default_backing_dev_info.wb.task); } +} + +static void bdi_queue_work(struct backing_dev_info *bdi, + struct wb_writeback_work *work) +{ + trace_writeback_queue(bdi, work); + + spin_lock_bh(&bdi->wb_lock); + list_add_tail(&work->list, &bdi->work_list); + if (!bdi->wb.task) + trace_writeback_nothread(bdi, work); + _bdi_wakeup_flusher(bdi); spin_unlock_bh(&bdi->wb_lock); } static void __bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, - bool range_cyclic, bool for_background) + bool range_cyclic) { struct wb_writeback_work *work; @@ -121,7 +128,6 @@ __bdi_start_writeback(struct backing_dev work->sync_mode = WB_SYNC_NONE; work->nr_pages = nr_pages; work->range_cyclic = range_cyclic; - work->for_background = for_background; bdi_queue_work(bdi, work); } @@ -139,7 +145,7 @@ __bdi_start_writeback(struct backing_dev */ void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages) { - __bdi_start_writeback(bdi, nr_pages, true, false); + __bdi_start_writeback(bdi, nr_pages, true); } /** @@ -147,13 +153,20 @@ void bdi_start_writeback(struct backing_ * @bdi: the backing device to write from * * Description: - * This does WB_SYNC_NONE background writeback. The IO is only - * started when this function returns, we make no guarentees on - * completion. Caller need not hold sb s_umount semaphore. + * This makes sure WB_SYNC_NONE background writeback happens. When + * this function returns, it is only guaranteed that for given BDI + * some IO is happening if we are over background dirty threshold. + * Caller need not hold sb s_umount semaphore. */ void bdi_start_background_writeback(struct backing_dev_info *bdi) { - __bdi_start_writeback(bdi, LONG_MAX, true, true); + /* + * We just wake up the flusher thread. It will perform background + * writeback as soon as there is no other work to do. + */ + spin_lock_bh(&bdi->wb_lock); + _bdi_wakeup_flusher(bdi); + spin_unlock_bh(&bdi->wb_lock); } /* @@ -724,6 +737,23 @@ get_next_work_item(struct backing_dev_in return work; } +static long wb_check_background_flush(struct bdi_writeback *wb) +{ + if (over_bground_thresh()) { + + struct wb_writeback_work work = { + .nr_pages = LONG_MAX, + .sync_mode = WB_SYNC_NONE, + .for_background = 1, + .range_cyclic = 1, + }; + + return wb_writeback(wb, &work); + } + + return 0; +} + static long wb_check_old_data_flush(struct bdi_writeback *wb) { unsigned long expired; @@ -795,6 +825,7 @@ long wb_do_writeback(struct bdi_writebac * Check for periodic writeback, kupdated() style */ wrote += wb_check_old_data_flush(wb); + wrote += wb_check_background_flush(wb); clear_bit(BDI_writeback_running, &wb->bdi->state); return wrote; @@ -881,7 +912,7 @@ void wakeup_flusher_threads(long nr_page list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { if (!bdi_has_dirty_io(bdi)) continue; - __bdi_start_writeback(bdi, nr_pages, false, false); + __bdi_start_writeback(bdi, nr_pages, false); } rcu_read_unlock(); } ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works 2010-11-01 12:14 ` [PATCH 1/2] writeback: integrated background writeback work Wu Fengguang @ 2010-11-01 12:22 ` Wu Fengguang 2010-11-01 15:22 ` Christoph Hellwig ` (2 more replies) 2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig 1 sibling, 3 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-01 12:22 UTC (permalink / raw) To: Andrew Morton, Jan Kara Cc: linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel From: Jan Kara <jack@suse.cz> Background writeback are easily livelockable (from a definition of their target). This is inconvenient because it can make sync(1) stall forever waiting on its queued work to be finished. Generally, when a flusher thread has some work queued, someone submitted the work to achieve a goal more specific than what background writeback does. So it makes sense to give it a priority over a generic page cleaning. Thus we interrupt background writeback if there is some other work to do. We return to the background writeback after completing all the queued work. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> --- fs/fs-writeback.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- linux-next.orig/fs/fs-writeback.c 2010-11-01 19:50:22.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-11-01 19:56:54.000000000 +0800 @@ -664,6 +664,15 @@ static long wb_writeback(struct bdi_writ break; /* + * Background writeout and kupdate-style writeback are + * easily livelockable. Stop them if there is other work + * to do so that e.g. sync can proceed. + */ + if ((work->for_background || work->for_kupdate) && + !list_empty(&wb->bdi->work_list)) + break; + + /* * For background writeout, stop when we are below the * background dirty threshold */ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang @ 2010-11-01 15:22 ` Christoph Hellwig 2010-11-02 1:57 ` Minchan Kim 2010-11-05 12:15 ` Johannes Weiner 2 siblings, 0 replies; 10+ messages in thread From: Christoph Hellwig @ 2010-11-01 15:22 UTC (permalink / raw) To: Wu Fengguang Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel Looks good. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang 2010-11-01 15:22 ` Christoph Hellwig @ 2010-11-02 1:57 ` Minchan Kim 2010-11-05 12:15 ` Johannes Weiner 2 siblings, 0 replies; 10+ messages in thread From: Minchan Kim @ 2010-11-02 1:57 UTC (permalink / raw) To: Wu Fengguang Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel On Mon, Nov 1, 2010 at 9:22 PM, Wu Fengguang <fengguang.wu@intel.com> wrote: > From: Jan Kara <jack@suse.cz> > > Background writeback are easily livelockable (from a definition of their > target). This is inconvenient because it can make sync(1) stall forever waiting > on its queued work to be finished. Generally, when a flusher thread has > some work queued, someone submitted the work to achieve a goal more specific > than what background writeback does. So it makes sense to give it a priority > over a generic page cleaning. > > Thus we interrupt background writeback if there is some other work to do. We > return to the background writeback after completing all the queued work. > > Signed-off-by: Jan Kara <jack@suse.cz> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> -- Kind regards, Minchan Kim ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang 2010-11-01 15:22 ` Christoph Hellwig 2010-11-02 1:57 ` Minchan Kim @ 2010-11-05 12:15 ` Johannes Weiner 2 siblings, 0 replies; 10+ messages in thread From: Johannes Weiner @ 2010-11-05 12:15 UTC (permalink / raw) To: Wu Fengguang Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel On Mon, Nov 01, 2010 at 08:22:52PM +0800, Wu Fengguang wrote: > From: Jan Kara <jack@suse.cz> > > Background writeback are easily livelockable (from a definition of their > target). This is inconvenient because it can make sync(1) stall forever waiting > on its queued work to be finished. Generally, when a flusher thread has > some work queued, someone submitted the work to achieve a goal more specific > than what background writeback does. So it makes sense to give it a priority > over a generic page cleaning. > > Thus we interrupt background writeback if there is some other work to do. We > return to the background writeback after completing all the queued work. > > Signed-off-by: Jan Kara <jack@suse.cz> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] writeback: integrated background writeback work 2010-11-01 12:14 ` [PATCH 1/2] writeback: integrated background writeback work Wu Fengguang 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang @ 2010-11-01 15:21 ` Christoph Hellwig 2010-11-01 20:37 ` Wu Fengguang 2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang 1 sibling, 2 replies; 10+ messages in thread From: Christoph Hellwig @ 2010-11-01 15:21 UTC (permalink / raw) To: Wu Fengguang Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, Christoph Hellwig, linux-fsdevel > +static void _bdi_wakeup_flusher(struct backing_dev_info *bdi) Remove the leading underscore, please. > void bdi_start_background_writeback(struct backing_dev_info *bdi) > { > - __bdi_start_writeback(bdi, LONG_MAX, true, true); > + /* > + * We just wake up the flusher thread. It will perform background > + * writeback as soon as there is no other work to do. > + */ > + spin_lock_bh(&bdi->wb_lock); > + _bdi_wakeup_flusher(bdi); > + spin_unlock_bh(&bdi->wb_lock); We probably want a trace point here, too. Otherwise the patch looks good to me. Thanks for bringing it up again. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2] writeback: integrated background writeback work 2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig @ 2010-11-01 20:37 ` Wu Fengguang 2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang 1 sibling, 0 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-01 20:37 UTC (permalink / raw) To: Christoph Hellwig Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, linux-fsdevel@vger.kernel.org On Mon, Nov 01, 2010 at 11:21:50PM +0800, Christoph Hellwig wrote: > > +static void _bdi_wakeup_flusher(struct backing_dev_info *bdi) > > Remove the leading underscore, please. OK, makes sense. The updated patch will follow. > > void bdi_start_background_writeback(struct backing_dev_info *bdi) > > { > > - __bdi_start_writeback(bdi, LONG_MAX, true, true); > > + /* > > + * We just wake up the flusher thread. It will perform background > > + * writeback as soon as there is no other work to do. > > + */ > > + spin_lock_bh(&bdi->wb_lock); > > + _bdi_wakeup_flusher(bdi); > > + spin_unlock_bh(&bdi->wb_lock); > > We probably want a trace point here, too. > > Otherwise the patch looks good to me. Thanks for bringing it up again. Thanks. It's trivial to add the trace point, here is the incremental patch. Thanks, Fengguang --- writeback: trace wakeup event for background writeback This tracks when balance_dirty_pages() tries to wakeup the flusher thread for background writeback (if it was not started already). Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> --- fs/fs-writeback.c | 1 + include/trace/events/writeback.h | 1 + 2 files changed, 2 insertions(+) --- linux-next.orig/include/trace/events/writeback.h 2010-11-02 04:17:26.000000000 +0800 +++ linux-next/include/trace/events/writeback.h 2010-11-02 04:21:02.000000000 +0800 @@ -81,6 +81,7 @@ DEFINE_EVENT(writeback_class, name, \ TP_ARGS(bdi)) DEFINE_WRITEBACK_EVENT(writeback_nowork); +DEFINE_WRITEBACK_EVENT(writeback_wake_background); DEFINE_WRITEBACK_EVENT(writeback_wake_thread); DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); DEFINE_WRITEBACK_EVENT(writeback_bdi_register); --- linux-next.orig/fs/fs-writeback.c 2010-11-02 04:22:17.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-11-02 04:22:33.000000000 +0800 @@ -164,6 +164,7 @@ void bdi_start_background_writeback(stru * We just wake up the flusher thread. It will perform background * writeback as soon as there is no other work to do. */ + trace_writeback_wake_background(bdi); spin_lock_bh(&bdi->wb_lock); bdi_wakeup_flusher(bdi); spin_unlock_bh(&bdi->wb_lock); ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/2 v2] writeback: integrated background writeback work 2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig 2010-11-01 20:37 ` Wu Fengguang @ 2010-11-01 20:39 ` Wu Fengguang 2010-11-02 1:55 ` Minchan Kim 2010-11-05 12:01 ` Johannes Weiner 1 sibling, 2 replies; 10+ messages in thread From: Wu Fengguang @ 2010-11-01 20:39 UTC (permalink / raw) To: Christoph Hellwig Cc: Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, linux-fsdevel@vger.kernel.org From: Jan Kara <jack@suse.cz> Check whether background writeback is needed after finishing each work. When bdi flusher thread finishes doing some work check whether any kind of background writeback needs to be done (either because dirty_background_ratio is exceeded or because we need to start flushing old inodes). If so, just do background write back. This way, bdi_start_background_writeback() just needs to wake up the flusher thread. It will do background writeback as soon as there is no other work. This is a preparatory patch for the next patch which stops background writeback as soon as there is other work to do. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> --- fs/fs-writeback.c | 61 +++++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 15 deletions(-) --- linux-next.orig/fs/fs-writeback.c 2010-11-02 04:37:39.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-11-02 04:37:45.000000000 +0800 @@ -79,13 +79,9 @@ static inline struct backing_dev_info *i return sb->s_bdi; } -static void bdi_queue_work(struct backing_dev_info *bdi, - struct wb_writeback_work *work) +/* Wakeup flusher thread or forker thread to fork it. Requires bdi->wb_lock. */ +static void bdi_wakeup_flusher(struct backing_dev_info *bdi) { - trace_writeback_queue(bdi, work); - - spin_lock_bh(&bdi->wb_lock); - list_add_tail(&work->list, &bdi->work_list); if (bdi->wb.task) { wake_up_process(bdi->wb.task); } else { @@ -93,15 +89,26 @@ static void bdi_queue_work(struct backin * The bdi thread isn't there, wake up the forker thread which * will create and run it. */ - trace_writeback_nothread(bdi, work); wake_up_process(default_backing_dev_info.wb.task); } +} + +static void bdi_queue_work(struct backing_dev_info *bdi, + struct wb_writeback_work *work) +{ + trace_writeback_queue(bdi, work); + + spin_lock_bh(&bdi->wb_lock); + list_add_tail(&work->list, &bdi->work_list); + if (!bdi->wb.task) + trace_writeback_nothread(bdi, work); + bdi_wakeup_flusher(bdi); spin_unlock_bh(&bdi->wb_lock); } static void __bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, - bool range_cyclic, bool for_background) + bool range_cyclic) { struct wb_writeback_work *work; @@ -121,7 +128,6 @@ __bdi_start_writeback(struct backing_dev work->sync_mode = WB_SYNC_NONE; work->nr_pages = nr_pages; work->range_cyclic = range_cyclic; - work->for_background = for_background; bdi_queue_work(bdi, work); } @@ -139,7 +145,7 @@ __bdi_start_writeback(struct backing_dev */ void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages) { - __bdi_start_writeback(bdi, nr_pages, true, false); + __bdi_start_writeback(bdi, nr_pages, true); } /** @@ -147,13 +153,20 @@ void bdi_start_writeback(struct backing_ * @bdi: the backing device to write from * * Description: - * This does WB_SYNC_NONE background writeback. The IO is only - * started when this function returns, we make no guarentees on - * completion. Caller need not hold sb s_umount semaphore. + * This makes sure WB_SYNC_NONE background writeback happens. When + * this function returns, it is only guaranteed that for given BDI + * some IO is happening if we are over background dirty threshold. + * Caller need not hold sb s_umount semaphore. */ void bdi_start_background_writeback(struct backing_dev_info *bdi) { - __bdi_start_writeback(bdi, LONG_MAX, true, true); + /* + * We just wake up the flusher thread. It will perform background + * writeback as soon as there is no other work to do. + */ + spin_lock_bh(&bdi->wb_lock); + bdi_wakeup_flusher(bdi); + spin_unlock_bh(&bdi->wb_lock); } /* @@ -724,6 +737,23 @@ get_next_work_item(struct backing_dev_in return work; } +static long wb_check_background_flush(struct bdi_writeback *wb) +{ + if (over_bground_thresh()) { + + struct wb_writeback_work work = { + .nr_pages = LONG_MAX, + .sync_mode = WB_SYNC_NONE, + .for_background = 1, + .range_cyclic = 1, + }; + + return wb_writeback(wb, &work); + } + + return 0; +} + static long wb_check_old_data_flush(struct bdi_writeback *wb) { unsigned long expired; @@ -795,6 +825,7 @@ long wb_do_writeback(struct bdi_writebac * Check for periodic writeback, kupdated() style */ wrote += wb_check_old_data_flush(wb); + wrote += wb_check_background_flush(wb); clear_bit(BDI_writeback_running, &wb->bdi->state); return wrote; @@ -881,7 +912,7 @@ void wakeup_flusher_threads(long nr_page list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) { if (!bdi_has_dirty_io(bdi)) continue; - __bdi_start_writeback(bdi, nr_pages, false, false); + __bdi_start_writeback(bdi, nr_pages, false); } rcu_read_unlock(); } ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] writeback: integrated background writeback work 2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang @ 2010-11-02 1:55 ` Minchan Kim 2010-11-05 12:01 ` Johannes Weiner 1 sibling, 0 replies; 10+ messages in thread From: Minchan Kim @ 2010-11-02 1:55 UTC (permalink / raw) To: Wu Fengguang Cc: Christoph Hellwig, Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Johannes Weiner, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, linux-fsdevel@vger.kernel.org On Tue, Nov 2, 2010 at 5:39 AM, Wu Fengguang <fengguang.wu@intel.com> wrote: > From: Jan Kara <jack@suse.cz> > > Check whether background writeback is needed after finishing each work. > > When bdi flusher thread finishes doing some work check whether any kind > of background writeback needs to be done (either because > dirty_background_ratio is exceeded or because we need to start flushing > old inodes). If so, just do background write back. > > This way, bdi_start_background_writeback() just needs to wake up the > flusher thread. It will do background writeback as soon as there is no > other work. > > This is a preparatory patch for the next patch which stops background > writeback as soon as there is other work to do. > > Signed-off-by: Jan Kara <jack@suse.cz> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> -- Kind regards, Minchan Kim ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/2 v2] writeback: integrated background writeback work 2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang 2010-11-02 1:55 ` Minchan Kim @ 2010-11-05 12:01 ` Johannes Weiner 1 sibling, 0 replies; 10+ messages in thread From: Johannes Weiner @ 2010-11-05 12:01 UTC (permalink / raw) To: Wu Fengguang Cc: Christoph Hellwig, Andrew Morton, Jan Kara, linux-mm@kvack.org, Mel Gorman, Rik van Riel, Minchan Kim, KAMEZAWA Hiroyuki, KOSAKI Motohiro, Dave Chinner, linux-fsdevel@vger.kernel.org On Tue, Nov 02, 2010 at 04:39:47AM +0800, Wu Fengguang wrote: > From: Jan Kara <jack@suse.cz> > > Check whether background writeback is needed after finishing each work. > > When bdi flusher thread finishes doing some work check whether any kind > of background writeback needs to be done (either because > dirty_background_ratio is exceeded or because we need to start flushing > old inodes). If so, just do background write back. > > This way, bdi_start_background_writeback() just needs to wake up the > flusher thread. It will do background writeback as soon as there is no > other work. > > This is a preparatory patch for the next patch which stops background > writeback as soon as there is other work to do. > > Signed-off-by: Jan Kara <jack@suse.cz> > Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-11-05 12:15 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20100913123110.372291929@intel.com> [not found] ` <20100913130149.994322762@intel.com> [not found] ` <20100914124033.GA4874@quack.suse.cz> 2010-11-01 12:14 ` [PATCH 1/2] writeback: integrated background writeback work Wu Fengguang 2010-11-01 12:22 ` [PATCH 2/2] writeback: stop background/kupdate works from livelocking other works Wu Fengguang 2010-11-01 15:22 ` Christoph Hellwig 2010-11-02 1:57 ` Minchan Kim 2010-11-05 12:15 ` Johannes Weiner 2010-11-01 15:21 ` [PATCH 1/2] writeback: integrated background writeback work Christoph Hellwig 2010-11-01 20:37 ` Wu Fengguang 2010-11-01 20:39 ` [PATCH 1/2 v2] " Wu Fengguang 2010-11-02 1:55 ` Minchan Kim 2010-11-05 12:01 ` Johannes Weiner
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).