[PATCH 2/7] writeback: add parameters to __bdi_update_bandwidth()

From: Wu Fengguang
Date: Sun Jun 19 2011 - 11:28:03 EST


The added parameters will be used by the next patch and more future patches.

It's separated out for easier review, and will be merged either with the
next patch or with the previous write bandwidth patch in future posts.

Signed-off-by: Wu Fengguang <fengguang.wu@xxxxxxxxx>
---
fs/fs-writeback.c | 2 +-
include/linux/writeback.h | 3 +++
mm/page-writeback.c | 21 +++++++++++++++++++--
3 files changed, 23 insertions(+), 3 deletions(-)

--- linux-next.orig/mm/page-writeback.c 2011-06-19 22:51:50.000000000 +0800
+++ linux-next/mm/page-writeback.c 2011-06-19 22:53:46.000000000 +0800
@@ -549,6 +549,9 @@ static void global_update_bandwidth(unsi
}

void __bdi_update_bandwidth(struct backing_dev_info *bdi,
+ unsigned long thresh,
+ unsigned long dirty,
+ unsigned long bdi_dirty,
unsigned long start_time)
{
unsigned long now = jiffies;
@@ -581,12 +593,16 @@ snapshot:
}

static void bdi_update_bandwidth(struct backing_dev_info *bdi,
+ unsigned long thresh,
+ unsigned long dirty,
+ unsigned long bdi_dirty,
unsigned long start_time)
{
if (jiffies - bdi->bw_time_stamp <= MAX_PAUSE + MAX_PAUSE / 10)
return;
if (spin_trylock(&bdi->wb.list_lock)) {
- __bdi_update_bandwidth(bdi, start_time);
+ __bdi_update_bandwidth(bdi, thresh, dirty, bdi_dirty,
+ start_time);
spin_unlock(&bdi->wb.list_lock);
}
}
@@ -673,7 +689,8 @@ static void balance_dirty_pages(struct a
if (!bdi->dirty_exceeded)
bdi->dirty_exceeded = 1;

- bdi_update_bandwidth(bdi, start_time);
+ bdi_update_bandwidth(bdi, dirty_thresh, nr_dirty, bdi_dirty,
+ start_time);

/* Note: nr_reclaimable denotes nr_dirty + nr_unstable.
* Unstable writes are a feature of certain networked
--- linux-next.orig/include/linux/writeback.h 2011-06-19 22:51:50.000000000 +0800
+++ linux-next/include/linux/writeback.h 2011-06-19 22:53:29.000000000 +0800
@@ -125,6 +125,9 @@ unsigned long bdi_dirty_limit(struct bac
unsigned long dirty);

void __bdi_update_bandwidth(struct backing_dev_info *bdi,
+ unsigned long thresh,
+ unsigned long dirty,
+ unsigned long bdi_dirty,
unsigned long start_time);

void page_writeback_init(void);
--- linux-next.orig/fs/fs-writeback.c 2011-06-19 22:51:50.000000000 +0800
+++ linux-next/fs/fs-writeback.c 2011-06-19 22:53:29.000000000 +0800
@@ -635,7 +635,7 @@ static inline bool over_bground_thresh(v
static void wb_update_bandwidth(struct bdi_writeback *wb,
unsigned long start_time)
{
- __bdi_update_bandwidth(wb->bdi, start_time);
+ __bdi_update_bandwidth(wb->bdi, 0, 0, 0, start_time);
}

/*


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/