From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: [PATCH 1/5] splice: move balance_dirty_pages_ratelimited into pipe_to_file Date: Thu, 12 Dec 2013 10:15:00 -0800 Message-ID: <20131212181844.501136902@bombadil.infradead.org> References: <20131212181459.994196463@bombadil.infradead.org> Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com To: Al Viro , Jens Axboe , Mark Fasheh , Joel Becker Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:51095 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519Ab3LLSSw (ORCPT ); Thu, 12 Dec 2013 13:18:52 -0500 Content-Disposition: inline; filename=0001-splice-move-balance_dirty_pages_ratelimited-into-pip.patch Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Try to balance the dirty pages for every written pages instead of once per system call, mirroring the regular write path. Signed-off-by: Christoph Hellwig --- fs/ocfs2/file.c | 2 -- fs/splice.c | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6fff128..a77ef6e 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2494,8 +2494,6 @@ static ssize_t ocfs2_file_splice_write(struct pipe_inode_info *pipe, ret = err; else *ppos += ret; - - balance_dirty_pages_ratelimited(mapping); } return ret; diff --git a/fs/splice.c b/fs/splice.c index 46a08f7..fcb459d 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -759,6 +759,10 @@ int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, } ret = pagecache_write_end(file, mapping, sd->pos, this_len, this_len, page, fsdata); + if (ret) + goto out; + + balance_dirty_pages_ratelimited(mapping); out: return ret; } @@ -1034,7 +1038,6 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out, ret = err; else *ppos += ret; - balance_dirty_pages_ratelimited(mapping); } return ret; -- 1.7.10.4