Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1363492
| Path | csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jens Axboe <axboe@fb.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/8] writeback: propagate the various reasons for writeback |
| Date | Wed, 23 Mar 2016 16:30:01 +0100 |
| Message-ID | <rfSTn-5lq-9@gated-at.bofh.it> (permalink) |
| References | <rfSTn-5lq-3@gated-at.bofh.it> |
| X-Original-To | <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>, <linux-block@vger.kernel.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=m5FOgnShWC9ilizUL4uSc6aYqBDQHHVWxn8Za+WVEeM=; b=PYPaO67DlVjF6kRWxKYnHq8GwI4PUG+526wOWYaTLBRXctcZMZG2eiXBAt9ZXjdTpZPr /HqpQIo73Bc860uVHKRVp7Ft1dbgIWJlZkNHYTsYZaN67tylJM4hch99fNx0tKXSF4in 6FwnkSR3grrEP5UeAhf6JbWXvnHbvk28LEI= |
| X-Mailer | git-send-email 2.4.1.168.g1ea28e1 |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| X-Originating-IP | [192.168.54.13] |
| X-Proofpoint-Spam-Reason | safe |
| X-Fb-Internal | Safe |
| X-Proofpoint-Virus-Version | vendor=fsecure engine=2.50.10432:,, definitions=2016-03-23_08:,, signatures=0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 52 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Jens Axboe <axboe@fb.com> |
| X-Original-Date | Wed, 23 Mar 2016 09:25:43 -0600 |
| X-Original-Message-ID | <1458746750-9213-2-git-send-email-axboe@fb.com> |
| X-Original-References | <1458746750-9213-1-git-send-email-axboe@fb.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1363492 |
Show key headers only | View raw
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 linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 1/8] writeback: propagate the various reasons for writeback Jens Axboe <axboe@fb.com> - 2016-03-23 16:30 +0100
csiph-web