Re: Link performance over NFS degraded in RHEL5. -- was : Read/Write NFS I/O performance degraded by FLUSH_STABLE page flushing

J. Bruce Fields
2009-06-16T00:33:58Z

On Tue, Jun 16, 2009 at 10:21:50AM +1000, NeilBrown wrote:
> On Tue, June 16, 2009 9:08 am, J. Bruce Fields wrote:
>
> > + if (host_err >= 0 && stable)
> > + wait_for_concurrent_writes(file, use_wgather, &host_err);
> >
>
> Surely you want this to be:
>
> if (host_err >= 0 && stable && use_wgather)
> host_err = wait_for_concurrent_writes(file);
> as
> - this is more readable
> - setting last_ino and last_dev is pointless when !use_wgather

Yep, thanks.

> - we aren't interested in differentiation between non-negative values of
> host_err.

Unfortunately, just below:

if (host_err >= 0) {
err = 0;
*cnt = host_err;
} else
err = nfserrno(host_err);

We could save that count earlier, e.g.:

@@ -1014,6 +1013,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
int host_err;
int stable = *stablep;
int use_wgather;
+ int bytes;

#ifdef MSNFS
err = nfserr_perm;
@@ -1056,6 +1056,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp,
set_fs(oldfs);
if (host_err >= 0) {
nfsdstats.io_write += host_err;
+ bytes = host_err;
fsnotify_modify(file->f_path.dentry);
}

@@ -1063,13 +1064,13 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fh
if (host_err >= 0 && (inode->i_mode & (S_ISUID | S_ISGID)))
kill_suid(dentry);

- if (host_err >= 0 && stable)
- wait_for_concurrent_writes(file, use_wgather, &host_err);
+ if (host_err >= 0 && stable && use_wgather)
+ host_err = wait_for_concurrent_writes(file);

dprintk("nfsd: write complete host_err=%d\n", host_err);
if (host_err >= 0) {
err = 0;
- *cnt = host_err;
+ *cnt = bytes;
} else
err = nfserrno(host_err);
out:

--b.