diff options
author | Curt Wohlgemuth <curtw@google.com> | 2011-10-07 23:54:10 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-10-30 12:33:36 -0400 |
commit | 0e175a1835ffc979e55787774e58ec79e41957d7 (patch) | |
tree | 6ec4b65a8de4e9d1c12d26a1079079ed81d79450 /mm | |
parent | ad4e38dd6a33bb3a4882c487d7abe621e583b982 (diff) |
writeback: Add a 'reason' to wb_writeback_work
This creates a new 'reason' field in a wb_writeback_work
structure, which unambiguously identifies who initiates
writeback activity. A 'wb_reason' enumeration has been
added to writeback.h, to enumerate the possible reasons.
The 'writeback_work_class' and tracepoint event class and
'writeback_queue_io' tracepoints are updated to include the
symbolic 'reason' in all trace events.
And the 'writeback_inodes_sbXXX' family of routines has had
a wb_stats parameter added to them, so callers can specify
why writeback is being started.
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 3 | ||||
-rw-r--r-- | mm/page-writeback.c | 3 | ||||
-rw-r--r-- | mm/vmscan.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 5dcaa3c756d..dd8916feb05 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -476,7 +476,8 @@ static int bdi_forker_thread(void *ptr) | |||
476 | * the bdi from the thread. Hopefully 1024 is | 476 | * the bdi from the thread. Hopefully 1024 is |
477 | * large enough for efficient IO. | 477 | * large enough for efficient IO. |
478 | */ | 478 | */ |
479 | writeback_inodes_wb(&bdi->wb, 1024); | 479 | writeback_inodes_wb(&bdi->wb, 1024, |
480 | WB_REASON_FORKER_THREAD); | ||
480 | } else { | 481 | } else { |
481 | /* | 482 | /* |
482 | * The spinlock makes sure we do not lose | 483 | * The spinlock makes sure we do not lose |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 45d36f7dc16..650846b6158 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -1301,7 +1301,8 @@ void laptop_mode_timer_fn(unsigned long data) | |||
1301 | * threshold | 1301 | * threshold |
1302 | */ | 1302 | */ |
1303 | if (bdi_has_dirty_io(&q->backing_dev_info)) | 1303 | if (bdi_has_dirty_io(&q->backing_dev_info)) |
1304 | bdi_start_writeback(&q->backing_dev_info, nr_pages); | 1304 | bdi_start_writeback(&q->backing_dev_info, nr_pages, |
1305 | WB_REASON_LAPTOP_TIMER); | ||
1305 | } | 1306 | } |
1306 | 1307 | ||
1307 | /* | 1308 | /* |
diff --git a/mm/vmscan.c b/mm/vmscan.c index b55699cd906..c735bd770d3 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2181,7 +2181,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist, | |||
2181 | */ | 2181 | */ |
2182 | writeback_threshold = sc->nr_to_reclaim + sc->nr_to_reclaim / 2; | 2182 | writeback_threshold = sc->nr_to_reclaim + sc->nr_to_reclaim / 2; |
2183 | if (total_scanned > writeback_threshold) { | 2183 | if (total_scanned > writeback_threshold) { |
2184 | wakeup_flusher_threads(laptop_mode ? 0 : total_scanned); | 2184 | wakeup_flusher_threads(laptop_mode ? 0 : total_scanned, |
2185 | WB_REASON_TRY_TO_FREE_PAGES); | ||
2185 | sc->may_writepage = 1; | 2186 | sc->may_writepage = 1; |
2186 | } | 2187 | } |
2187 | 2188 | ||