diff mbox

[RFC,3/3] ext4: tag asynchronous writeback io

Message ID 1471411245-5186-4-git-send-email-daeho.jeong@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Daeho Jeong Aug. 17, 2016, 5:20 a.m. UTC
Set the page with PG_asyncwb and PG_plugged, and set the bio with
BIO_ASYNC_WB when submitting asynchronous writeback I/O in order to
mark which pages are flushed as asynchronous writeback I/O and which
one stays in the plug list.

Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
---
 fs/ext4/page-io.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 2a01df9..5912e59 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -370,6 +370,10 @@  static int io_submit_init_bio(struct ext4_io_submit *io,
 	bio->bi_private = ext4_get_io_end(io->io_end);
 	io->io_bio = bio;
 	io->io_next_block = bh->b_blocknr;
+#ifdef CONFIG_BOOST_URGENT_ASYNC_WB
+	if (io->io_wbc->sync_mode == WB_SYNC_NONE)
+		bio->bi_flags |= (1 << BIO_ASYNC_WB);
+#endif
 	return 0;
 }
 
@@ -416,6 +420,13 @@  int ext4_bio_write_page(struct ext4_io_submit *io,
 	BUG_ON(!PageLocked(page));
 	BUG_ON(PageWriteback(page));
 
+#ifdef CONFIG_BOOST_URGENT_ASYNC_WB
+	if (wbc->sync_mode == WB_SYNC_NONE) {
+		SetPagePlugged(page);
+		SetPageAsyncWB(page);
+	}
+#endif
+
 	if (keep_towrite)
 		set_page_writeback_keepwrite(page);
 	else