From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Tue, 15 May 2018 22:31:10 +0200 Subject: [Cluster-devel] [GFS2 PATCH 2/2] GFS2: Submit all ordered writes in bulk, wait after that In-Reply-To: <20180514141857.27461-1-rpeterso@redhat.com> References: <20180514141857.27461-1-rpeterso@redhat.com> Message-ID: <20180515203110.19885-1-agruenba@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Bob, On 14 May 2018 at 16:18, Bob Peterson wrote: > Before this patch, the ordered_write function would submit all > the ordered writes with filemap_fdatawrite, which waited for each > one to complete before moving on to the next. This patch allows it > to submit them all, then wait for them after they're submitted. this looks reasonable. I think it's not very helpful to reuse gfs2_ordered_wait here though: the folowing incremental patch should work just as well or better. Andreas --- fs/gfs2/log.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index b05d0fbc3d05..2a9b1c008325 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -577,12 +577,15 @@ static void gfs2_ordered_write(struct gfs2_sbd *sdp) continue; } list_move_tail(&ip->i_ordered, &written); - spin_unlock(&sdp->sd_ordered_lock); - mapping->a_ops->writepages(mapping, &wbc); - spin_lock(&sdp->sd_ordered_lock); } spin_unlock(&sdp->sd_ordered_lock); - gfs2_ordered_wait(sdp, &written, &sdp->sd_log_le_ordered); + list_for_each_entry(ip, &written, i_ordered) + mapping->a_ops->writepages(ip->i_inode.i_mapping, &wbc); + list_for_each_entry(ip, &written, i_ordered) + filemap_fdatawait(ip->i_inode.i_mapping); + spin_lock(&sdp->sd_ordered_lock); + list_splice_tail(&written, &sdp->sd_log_le_ordered); + spin_unlock(&sdp->sd_ordered_lock); } void gfs2_ordered_del_inode(struct gfs2_inode *ip) -- 2.17.0