Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196870
b: refs/heads/master
c: 6423104
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed May 21, 2010
1 parent 1f9322c commit 1a85856
Show file tree
Hide file tree
Showing 4 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: f9eadbbd424c083b8005c7b738f644611b9ef489
refs/heads/master: 6423104b6a1e6f0c18be60e8c33f02d263331d5e
1 change: 1 addition & 0 deletions trunk/include/linux/backing-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
long nr_pages, int sb_locked);
int bdi_writeback_task(struct bdi_writeback *wb);
int bdi_has_dirty_io(struct backing_dev_info *bdi);
void bdi_arm_supers_timer(void);

extern spinlock_t bdi_lock;
extern struct list_head bdi_list;
Expand Down
15 changes: 10 additions & 5 deletions trunk/mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static struct timer_list sync_supers_timer;

static int bdi_sync_supers(void *);
static void sync_supers_timer_fn(unsigned long);
static void arm_supers_timer(void);

static void bdi_add_default_flusher_task(struct backing_dev_info *bdi);

Expand Down Expand Up @@ -252,7 +251,7 @@ static int __init default_bdi_init(void)

init_timer(&sync_supers_timer);
setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0);
arm_supers_timer();
bdi_arm_supers_timer();

err = bdi_init(&default_backing_dev_info);
if (!err)
Expand Down Expand Up @@ -374,18 +373,21 @@ static int bdi_sync_supers(void *unused)
return 0;
}

static void arm_supers_timer(void)
void bdi_arm_supers_timer(void)
{
unsigned long next;

if (!dirty_writeback_interval)
return;

next = msecs_to_jiffies(dirty_writeback_interval * 10) + jiffies;
mod_timer(&sync_supers_timer, round_jiffies_up(next));
}

static void sync_supers_timer_fn(unsigned long unused)
{
wake_up_process(sync_supers_tsk);
arm_supers_timer();
bdi_arm_supers_timer();
}

static int bdi_forker_task(void *ptr)
Expand Down Expand Up @@ -428,7 +430,10 @@ static int bdi_forker_task(void *ptr)

spin_unlock_bh(&bdi_lock);
wait = msecs_to_jiffies(dirty_writeback_interval * 10);
schedule_timeout(wait);
if (wait)
schedule_timeout(wait);
else
schedule();
try_to_freeze();
continue;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ int dirty_writeback_centisecs_handler(ctl_table *table, int write,
void __user *buffer, size_t *length, loff_t *ppos)
{
proc_dointvec(table, write, buffer, length, ppos);
bdi_arm_supers_timer();
return 0;
}

Expand Down

0 comments on commit 1a85856

Please sign in to comment.