Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274363
b: refs/heads/master
c: b00949a
h: refs/heads/master
i:
  274361: 069734f
  274359: fcd09d5
v: v3
  • Loading branch information
Wu Fengguang committed Oct 3, 2011
1 parent 3a4b969 commit 6867abf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8927f66c4ede9a18b4b58f7e6f9debca67065f6b
refs/heads/master: b00949aa2df9970a912bf060bc95e99da356881c
17 changes: 12 additions & 5 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,21 @@ long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages)
return nr_pages - work.nr_pages;
}

static inline bool over_bground_thresh(void)
static bool over_bground_thresh(struct backing_dev_info *bdi)
{
unsigned long background_thresh, dirty_thresh;

global_dirty_limits(&background_thresh, &dirty_thresh);

return (global_page_state(NR_FILE_DIRTY) +
global_page_state(NR_UNSTABLE_NFS) > background_thresh);
if (global_page_state(NR_FILE_DIRTY) +
global_page_state(NR_UNSTABLE_NFS) > background_thresh)
return true;

if (bdi_stat(bdi, BDI_RECLAIMABLE) >
bdi_dirty_limit(bdi, background_thresh))
return true;

return false;
}

/*
Expand Down Expand Up @@ -727,7 +734,7 @@ static long wb_writeback(struct bdi_writeback *wb,
* For background writeout, stop when we are below the
* background dirty threshold
*/
if (work->for_background && !over_bground_thresh())
if (work->for_background && !over_bground_thresh(wb->bdi))
break;

if (work->for_kupdate) {
Expand Down Expand Up @@ -811,7 +818,7 @@ static unsigned long get_nr_dirty_pages(void)

static long wb_check_background_flush(struct bdi_writeback *wb)
{
if (over_bground_thresh()) {
if (over_bground_thresh(wb->bdi)) {

struct wb_writeback_work work = {
.nr_pages = LONG_MAX,
Expand Down

0 comments on commit 6867abf

Please sign in to comment.