lkml.org 
[lkml]   [2011]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/7] writeback: add parameters to __bdi_update_bandwidth()
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@intel.com>
---
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);
}

/*



\
 
 \ /
  Last update: 2011-06-19 17:31    [from the cache]
©2003-2011 Jasper Spaans