diff options
Diffstat (limited to 'mm/backing-dev.c')
| -rw-r--r-- | mm/backing-dev.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 707d0dc6da0f..123bcef13e51 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
| @@ -48,7 +48,6 @@ static struct timer_list sync_supers_timer; | |||
| 48 | 48 | ||
| 49 | static int bdi_sync_supers(void *); | 49 | static int bdi_sync_supers(void *); |
| 50 | static void sync_supers_timer_fn(unsigned long); | 50 | static void sync_supers_timer_fn(unsigned long); |
| 51 | static void arm_supers_timer(void); | ||
| 52 | 51 | ||
| 53 | static void bdi_add_default_flusher_task(struct backing_dev_info *bdi); | 52 | static void bdi_add_default_flusher_task(struct backing_dev_info *bdi); |
| 54 | 53 | ||
| @@ -105,15 +104,13 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v) | |||
| 105 | "b_more_io: %8lu\n" | 104 | "b_more_io: %8lu\n" |
| 106 | "bdi_list: %8u\n" | 105 | "bdi_list: %8u\n" |
| 107 | "state: %8lx\n" | 106 | "state: %8lx\n" |
| 108 | "wb_mask: %8lx\n" | 107 | "wb_list: %8u\n", |
| 109 | "wb_list: %8u\n" | ||
| 110 | "wb_cnt: %8u\n", | ||
| 111 | (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)), | 108 | (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)), |
| 112 | (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)), | 109 | (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)), |
| 113 | K(bdi_thresh), K(dirty_thresh), | 110 | K(bdi_thresh), K(dirty_thresh), |
| 114 | K(background_thresh), nr_wb, nr_dirty, nr_io, nr_more_io, | 111 | K(background_thresh), nr_wb, nr_dirty, nr_io, nr_more_io, |
| 115 | !list_empty(&bdi->bdi_list), bdi->state, bdi->wb_mask, | 112 | !list_empty(&bdi->bdi_list), bdi->state, |
| 116 | !list_empty(&bdi->wb_list), bdi->wb_cnt); | 113 | !list_empty(&bdi->wb_list)); |
| 117 | #undef K | 114 | #undef K |
| 118 | 115 | ||
| 119 | return 0; | 116 | return 0; |
| @@ -252,7 +249,7 @@ static int __init default_bdi_init(void) | |||
| 252 | 249 | ||
| 253 | init_timer(&sync_supers_timer); | 250 | init_timer(&sync_supers_timer); |
| 254 | setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0); | 251 | setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0); |
| 255 | arm_supers_timer(); | 252 | bdi_arm_supers_timer(); |
| 256 | 253 | ||
| 257 | err = bdi_init(&default_backing_dev_info); | 254 | err = bdi_init(&default_backing_dev_info); |
| 258 | if (!err) | 255 | if (!err) |
| @@ -341,14 +338,13 @@ int bdi_has_dirty_io(struct backing_dev_info *bdi) | |||
| 341 | static void bdi_flush_io(struct backing_dev_info *bdi) | 338 | static void bdi_flush_io(struct backing_dev_info *bdi) |
| 342 | { | 339 | { |
| 343 | struct writeback_control wbc = { | 340 | struct writeback_control wbc = { |
| 344 | .bdi = bdi, | ||
| 345 | .sync_mode = WB_SYNC_NONE, | 341 | .sync_mode = WB_SYNC_NONE, |
| 346 | .older_than_this = NULL, | 342 | .older_than_this = NULL, |
| 347 | .range_cyclic = 1, | 343 | .range_cyclic = 1, |
| 348 | .nr_to_write = 1024, | 344 | .nr_to_write = 1024, |
| 349 | }; | 345 | }; |
| 350 | 346 | ||
| 351 | writeback_inodes_wbc(&wbc); | 347 | writeback_inodes_wb(&bdi->wb, &wbc); |
| 352 | } | 348 | } |
| 353 | 349 | ||
| 354 | /* | 350 | /* |
| @@ -374,10 +370,13 @@ static int bdi_sync_supers(void *unused) | |||
| 374 | return 0; | 370 | return 0; |
| 375 | } | 371 | } |
| 376 | 372 | ||
| 377 | static void arm_supers_timer(void) | 373 | void bdi_arm_supers_timer(void) |
| 378 | { | 374 | { |
| 379 | unsigned long next; | 375 | unsigned long next; |
| 380 | 376 | ||
| 377 | if (!dirty_writeback_interval) | ||
| 378 | return; | ||
| 379 | |||
| 381 | next = msecs_to_jiffies(dirty_writeback_interval * 10) + jiffies; | 380 | next = msecs_to_jiffies(dirty_writeback_interval * 10) + jiffies; |
| 382 | mod_timer(&sync_supers_timer, round_jiffies_up(next)); | 381 | mod_timer(&sync_supers_timer, round_jiffies_up(next)); |
| 383 | } | 382 | } |
| @@ -385,7 +384,7 @@ static void arm_supers_timer(void) | |||
| 385 | static void sync_supers_timer_fn(unsigned long unused) | 384 | static void sync_supers_timer_fn(unsigned long unused) |
| 386 | { | 385 | { |
| 387 | wake_up_process(sync_supers_tsk); | 386 | wake_up_process(sync_supers_tsk); |
| 388 | arm_supers_timer(); | 387 | bdi_arm_supers_timer(); |
| 389 | } | 388 | } |
| 390 | 389 | ||
| 391 | static int bdi_forker_task(void *ptr) | 390 | static int bdi_forker_task(void *ptr) |
| @@ -428,7 +427,10 @@ static int bdi_forker_task(void *ptr) | |||
| 428 | 427 | ||
| 429 | spin_unlock_bh(&bdi_lock); | 428 | spin_unlock_bh(&bdi_lock); |
| 430 | wait = msecs_to_jiffies(dirty_writeback_interval * 10); | 429 | wait = msecs_to_jiffies(dirty_writeback_interval * 10); |
| 431 | schedule_timeout(wait); | 430 | if (wait) |
| 431 | schedule_timeout(wait); | ||
| 432 | else | ||
| 433 | schedule(); | ||
| 432 | try_to_freeze(); | 434 | try_to_freeze(); |
| 433 | continue; | 435 | continue; |
| 434 | } | 436 | } |
| @@ -670,12 +672,6 @@ int bdi_init(struct backing_dev_info *bdi) | |||
| 670 | 672 | ||
| 671 | bdi_wb_init(&bdi->wb, bdi); | 673 | bdi_wb_init(&bdi->wb, bdi); |
| 672 | 674 | ||
| 673 | /* | ||
| 674 | * Just one thread support for now, hard code mask and count | ||
| 675 | */ | ||
| 676 | bdi->wb_mask = 1; | ||
| 677 | bdi->wb_cnt = 1; | ||
| 678 | |||
| 679 | for (i = 0; i < NR_BDI_STAT_ITEMS; i++) { | 675 | for (i = 0; i < NR_BDI_STAT_ITEMS; i++) { |
| 680 | err = percpu_counter_init(&bdi->bdi_stat[i], 0); | 676 | err = percpu_counter_init(&bdi->bdi_stat[i], 0); |
| 681 | if (err) | 677 | if (err) |
