Whamcloud - gitweb
LU-18252 llite: do not unplug the queue on each page 49/56449/6
authorAlex Zhuravlev <bzzz@whamcloud.com>
Sat, 21 Sep 2024 11:07:22 +0000 (14:07 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Jan 2025 20:48:38 +0000 (20:48 +0000)
for sync IO ll_write_end() calls into vvp_io_write_commit() at
every page. this get us to:

/* for sync write, kernel will wait for this page to be flushed
 * osc_io_end() is called, so release it earlier.
 * for mkwrite(), it's known there is no further pages. */
if (cl_io_is_sync_write(io) && oio->oi_active != NULL) {
osc_extent_release(env, oio->oi_active);
oio->oi_active = NULL;
}

ptlrpcd can be quick enough to intercept current (just reset) extent
and start to process that while the original is still continuing.

in the end this can result in suboptimal RPCs.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie53d0cc7bb52a7ec12b39cfe3da86a623bf03f12
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56449
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/rw26.c

index 38d377f..1ce7e4e 100644 (file)
@@ -1049,7 +1049,11 @@ static int ll_write_end(struct file *file, struct address_space *mapping,
                /* page list is not contiguous now, commit it now */
                unplug = true;
        }
-       if (unplug || io->u.ci_wr.wr_sync)
+       /* the last call into ->write_begin() can unplug the queue */
+       if (io->u.ci_wr.wr_sync && pos + len ==
+           io->u.ci_rw.crw_pos + io->u.ci_rw.crw_bytes)
+               unplug = true;
+       if (unplug)
                result = vvp_io_write_commit(env, io);
 
        if (result < 0)