Message ID | 1344390577-1602-1-git-send-email-bergwolf@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
T24gV2VkLCAyMDEyLTA4LTA4IGF0IDA5OjQ5ICswODAwLCBQZW5nIFRhbyB3cm90ZToNCj4gcG5m c193aXRoaW5fbWRzdGhyZXNob2xkKCkgaXMgY2FsbGVkIGluc2lkZSBwZ19pbml0LiBXZSBuZWVk DQo+IHRvIHNldCByZWFkX2lvL3dyaXRlX2lvIGJlZm9yZSB0aGF0Lg0KDQpXaHk/DQoNCi0tIA0K VHJvbmQgTXlrbGVidXN0DQpMaW51eCBORlMgY2xpZW50IG1haW50YWluZXINCg0KTmV0QXBwDQpU cm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNvbQ0Kd3d3Lm5ldGFwcC5jb20NCg0K -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Aug 9, 2012 at 3:03 AM, Myklebust, Trond <Trond.Myklebust@netapp.com> wrote: > On Wed, 2012-08-08 at 09:49 +0800, Peng Tao wrote: >> pnfs_within_mdsthreshold() is called inside pg_init. We need >> to set read_io/write_io before that. > > Why? If we don't set read_io/write_io before calling pg_init, we fail pnfs_within_mdsthreshold() and IO goes to MDS. A simple test case: dd if=foo of=/mnt/pnfs/bar bs=10M count=1 oflag=direct
On Thu, 2012-08-09 at 10:36 +0800, Peng Tao wrote: > On Thu, Aug 9, 2012 at 3:03 AM, Myklebust, Trond > <Trond.Myklebust@netapp.com> wrote: > > On Wed, 2012-08-08 at 09:49 +0800, Peng Tao wrote: > >> pnfs_within_mdsthreshold() is called inside pg_init. We need > >> to set read_io/write_io before that. > > > > Why? > If we don't set read_io/write_io before calling pg_init, we fail > pnfs_within_mdsthreshold() and IO goes to MDS. > A simple test case: > dd if=foo of=/mnt/pnfs/bar bs=10M count=1 oflag=direct > My point was that this explanation needs to go into the changelog of the commit. -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@netapp.com www.netapp.com
On Thu, Aug 9, 2012 at 10:25 PM, Myklebust, Trond <Trond.Myklebust@netapp.com> wrote: > On Thu, 2012-08-09 at 10:36 +0800, Peng Tao wrote: >> On Thu, Aug 9, 2012 at 3:03 AM, Myklebust, Trond >> <Trond.Myklebust@netapp.com> wrote: >> > On Wed, 2012-08-08 at 09:49 +0800, Peng Tao wrote: >> >> pnfs_within_mdsthreshold() is called inside pg_init. We need >> >> to set read_io/write_io before that. >> > >> > Why? >> If we don't set read_io/write_io before calling pg_init, we fail >> pnfs_within_mdsthreshold() and IO goes to MDS. >> A simple test case: >> dd if=foo of=/mnt/pnfs/bar bs=10M count=1 oflag=direct >> > > My point was that this explanation needs to go into the changelog of the > commit. OK. Will resend the patch with proper changelog.
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 1ba385b..34a6282 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -463,10 +463,10 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, if (!is_sync_kiocb(iocb)) dreq->iocb = iocb; + NFS_I(inode)->read_io += iov_length(iov, nr_segs); result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos, uio); if (!result) result = nfs_direct_wait(dreq); - NFS_I(inode)->read_io += result; out_release: nfs_direct_req_release(dreq); out: @@ -814,6 +814,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, get_dreq(dreq); atomic_inc(&inode->i_dio_count); + NFS_I(dreq->inode)->write_io += iov_length(iov, nr_segs); for (seg = 0; seg < nr_segs; seg++) { const struct iovec *vec = &iov[seg]; result = nfs_direct_write_schedule_segment(&desc, vec, pos, uio); @@ -825,7 +826,6 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, pos += vec->iov_len; } nfs_pageio_complete(&desc); - NFS_I(dreq->inode)->write_io += desc.pg_bytes_written; /* * If no bytes were started, return the error, and let the
pnfs_within_mdsthreshold() is called inside pg_init. We need to set read_io/write_io before that. Cc: Andy Adamson <andros@netapp.com> Signed-off-by: Peng Tao <tao.peng@emc.com> --- fs/nfs/direct.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)