diff options
Diffstat (limited to 'fs/fs-writeback.c')
-rw-r--r-- | fs/fs-writeback.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index e2951506434d..f855916657ba 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
23 | #include <linux/pagemap.h> | ||
23 | #include <linux/kthread.h> | 24 | #include <linux/kthread.h> |
24 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
25 | #include <linux/writeback.h> | 26 | #include <linux/writeback.h> |
@@ -29,6 +30,11 @@ | |||
29 | #include "internal.h" | 30 | #include "internal.h" |
30 | 31 | ||
31 | /* | 32 | /* |
33 | * 4MB minimal write chunk size | ||
34 | */ | ||
35 | #define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10)) | ||
36 | |||
37 | /* | ||
32 | * Passed into wb_writeback(), essentially a subset of writeback_control | 38 | * Passed into wb_writeback(), essentially a subset of writeback_control |
33 | */ | 39 | */ |
34 | struct wb_writeback_work { | 40 | struct wb_writeback_work { |
@@ -742,11 +748,17 @@ static long wb_writeback(struct bdi_writeback *wb, | |||
742 | if (work->for_background && !over_bground_thresh(wb->bdi)) | 748 | if (work->for_background && !over_bground_thresh(wb->bdi)) |
743 | break; | 749 | break; |
744 | 750 | ||
751 | /* | ||
752 | * Kupdate and background works are special and we want to | ||
753 | * include all inodes that need writing. Livelock avoidance is | ||
754 | * handled by these works yielding to any other work so we are | ||
755 | * safe. | ||
756 | */ | ||
745 | if (work->for_kupdate) { | 757 | if (work->for_kupdate) { |
746 | oldest_jif = jiffies - | 758 | oldest_jif = jiffies - |
747 | msecs_to_jiffies(dirty_expire_interval * 10); | 759 | msecs_to_jiffies(dirty_expire_interval * 10); |
748 | work->older_than_this = &oldest_jif; | 760 | } else if (work->for_background) |
749 | } | 761 | oldest_jif = jiffies; |
750 | 762 | ||
751 | trace_writeback_start(wb->bdi, work); | 763 | trace_writeback_start(wb->bdi, work); |
752 | if (list_empty(&wb->b_io)) | 764 | if (list_empty(&wb->b_io)) |