diff options
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 9c1c199f88ce..a9a08d88a745 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -439,10 +439,17 @@ static int bdi_forker_thread(void *ptr) | |||
439 | break; | 439 | break; |
440 | 440 | ||
441 | case NO_ACTION: | 441 | case NO_ACTION: |
442 | if (dirty_writeback_interval) | 442 | if (!wb_has_dirty_io(me) || !dirty_writeback_interval) |
443 | schedule_timeout(msecs_to_jiffies(dirty_writeback_interval * 10)); | 443 | /* |
444 | * There are no dirty data. The only thing we | ||
445 | * should now care about is checking for | ||
446 | * inactive bdi threads and killing them. Thus, | ||
447 | * let's sleep for longer time, save energy and | ||
448 | * be friendly for battery-driven devices. | ||
449 | */ | ||
450 | schedule_timeout(bdi_longest_inactive()); | ||
444 | else | 451 | else |
445 | schedule(); | 452 | schedule_timeout(msecs_to_jiffies(dirty_writeback_interval * 10)); |
446 | try_to_freeze(); | 453 | try_to_freeze(); |
447 | /* Back to the main loop */ | 454 | /* Back to the main loop */ |
448 | continue; | 455 | continue; |