Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1363492 > unrolled thread
| Started by | Jens Axboe <axboe@fb.com> |
|---|---|
| First post | 2016-03-23 16:30 +0100 |
| Last post | 2016-03-23 16:30 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 1/8] writeback: propagate the various reasons for writeback Jens Axboe <axboe@fb.com> - 2016-03-23 16:30 +0100
| From | Jens Axboe <axboe@fb.com> |
|---|---|
| Date | 2016-03-23 16:30 +0100 |
| Subject | [PATCH 1/8] writeback: propagate the various reasons for writeback |
| Message-ID | <rfSTn-5lq-9@gated-at.bofh.it> |
Avoid losing context by propagating the various reason why we
initiate writeback.
Signed-off-by: Jens Axboe <axboe@fb.com>
---
fs/fs-writeback.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 5c46ed9f3e14..387610cf4f7f 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -52,6 +52,7 @@ struct wb_writeback_work {
unsigned int range_cyclic:1;
unsigned int for_background:1;
unsigned int for_sync:1; /* sync(2) WB_SYNC_ALL writeback */
+ unsigned int for_reclaim:1; /* for mem reclaim */
unsigned int auto_free:1; /* free on completion */
enum wb_reason reason; /* why was writeback initiated? */
@@ -942,6 +943,21 @@ void wb_start_writeback(struct bdi_writeback *wb, long nr_pages,
work->reason = reason;
work->auto_free = 1;
+ switch (reason) {
+ case WB_REASON_BACKGROUND:
+ case WB_REASON_PERIODIC:
+ work->for_background = 1;
+ break;
+ case WB_REASON_TRY_TO_FREE_PAGES:
+ case WB_REASON_FREE_MORE_MEM:
+ work->for_reclaim = 1;
+ case WB_REASON_SYNC:
+ work->for_sync = 1;
+ break;
+ default:
+ break;
+ }
+
wb_queue_work(wb, work);
}
@@ -1443,6 +1459,7 @@ static long writeback_sb_inodes(struct super_block *sb,
.for_kupdate = work->for_kupdate,
.for_background = work->for_background,
.for_sync = work->for_sync,
+ .for_reclaim = work->for_reclaim,
.range_cyclic = work->range_cyclic,
.range_start = 0,
.range_end = LLONG_MAX,
--
2.4.1.168.g1ea28e1
Back to top | Article view | linux.kernel
csiph-web