Re: [lkp-robot] [fs] 91f9943e1c: aim7.jobs-per-min -26.6% regression

From: Christoph Hellwig
Date: Mon Oct 16 2017 - 03:34:23 EST


The only change for the non-nowait case is that we now do a trylock before
locking i_rwsem. In the past that was the more optimal pattern. Can you
test the patch below if that's not the case anymore? We have a few more
instances like that which might also want to be changed then.

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 309e26c9dddb..ad61c78605d1 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -258,10 +258,11 @@ xfs_file_buffered_aio_read(
ssize_t ret;

trace_xfs_file_buffered_read(ip, iov_iter_count(to), iocb->ki_pos);
-
- if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED)) {
- if (iocb->ki_flags & IOCB_NOWAIT)
+
+ if (iocb->ki_flags & IOCB_NOWAIT) {
+ if (!xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED))
return -EAGAIN;
+ } else {
xfs_ilock(ip, XFS_IOLOCK_SHARED);
}
ret = generic_file_read_iter(iocb, to);