提交 06342cf8 编写于 作者: C Christoph Hellwig 提交者: Alex Elder

xfs: use WRITE_SYNC_PLUG for synchronous writeout

The VM and I/O schedulers now expect us to use WRITE_SYNC_PLUG for
synchronous writeout.  Right now I can't see any changes in performance
numbers with this, but we're getting some beating for not using it,
and the knowledge definitely could help the block code to make better
decisions.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NAlex Elder <aelder@sgi.com>
Signed-off-by: NAlex Elder <aelder@sgi.com>
上级 033da48f
...@@ -412,6 +412,7 @@ xfs_end_bio( ...@@ -412,6 +412,7 @@ xfs_end_bio(
STATIC void STATIC void
xfs_submit_ioend_bio( xfs_submit_ioend_bio(
struct writeback_control *wbc,
xfs_ioend_t *ioend, xfs_ioend_t *ioend,
struct bio *bio) struct bio *bio)
{ {
...@@ -426,7 +427,8 @@ xfs_submit_ioend_bio( ...@@ -426,7 +427,8 @@ xfs_submit_ioend_bio(
if (xfs_ioend_new_eof(ioend)) if (xfs_ioend_new_eof(ioend))
xfs_mark_inode_dirty_sync(XFS_I(ioend->io_inode)); xfs_mark_inode_dirty_sync(XFS_I(ioend->io_inode));
submit_bio(WRITE, bio); submit_bio(wbc->sync_mode == WB_SYNC_ALL ?
WRITE_SYNC_PLUG : WRITE, bio);
ASSERT(!bio_flagged(bio, BIO_EOPNOTSUPP)); ASSERT(!bio_flagged(bio, BIO_EOPNOTSUPP));
bio_put(bio); bio_put(bio);
} }
...@@ -505,6 +507,7 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh) ...@@ -505,6 +507,7 @@ static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)
*/ */
STATIC void STATIC void
xfs_submit_ioend( xfs_submit_ioend(
struct writeback_control *wbc,
xfs_ioend_t *ioend) xfs_ioend_t *ioend)
{ {
xfs_ioend_t *head = ioend; xfs_ioend_t *head = ioend;
...@@ -533,19 +536,19 @@ xfs_submit_ioend( ...@@ -533,19 +536,19 @@ xfs_submit_ioend(
retry: retry:
bio = xfs_alloc_ioend_bio(bh); bio = xfs_alloc_ioend_bio(bh);
} else if (bh->b_blocknr != lastblock + 1) { } else if (bh->b_blocknr != lastblock + 1) {
xfs_submit_ioend_bio(ioend, bio); xfs_submit_ioend_bio(wbc, ioend, bio);
goto retry; goto retry;
} }
if (bio_add_buffer(bio, bh) != bh->b_size) { if (bio_add_buffer(bio, bh) != bh->b_size) {
xfs_submit_ioend_bio(ioend, bio); xfs_submit_ioend_bio(wbc, ioend, bio);
goto retry; goto retry;
} }
lastblock = bh->b_blocknr; lastblock = bh->b_blocknr;
} }
if (bio) if (bio)
xfs_submit_ioend_bio(ioend, bio); xfs_submit_ioend_bio(wbc, ioend, bio);
xfs_finish_ioend(ioend, 0); xfs_finish_ioend(ioend, 0);
} while ((ioend = next) != NULL); } while ((ioend = next) != NULL);
} }
...@@ -1198,7 +1201,7 @@ xfs_page_state_convert( ...@@ -1198,7 +1201,7 @@ xfs_page_state_convert(
} }
if (iohead) if (iohead)
xfs_submit_ioend(iohead); xfs_submit_ioend(wbc, iohead);
return page_dirty; return page_dirty;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册