From: Konstantin Khlebnikov <khlebnikov@parallels.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
Trond Myklebust <Trond.Myklebust@netapp.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] NFS: account direct-io into task io accounting
Date: Tue, 22 Feb 2011 00:27:32 +0300 [thread overview]
Message-ID: <4D62D8C4.3030004@parallels.com> (raw)
In-Reply-To: <CE953B49-D775-4A61-942B-4B2F5DE9D7BF@oracle.com>
Chuck Lever wrote:
>
> On Feb 21, 2011, at 11:15 AM, Konstantin Khlebnikov wrote:
>
>> Account complete NFS direct-io reads and writes into Task I/O Accounting.
>>
>> NFS have unusual direct-io implementation,
>> thus accounting in generic code does not work.
>>
>> Signed-off-by: Konstantin Khlebnikov<khlebnikov@openvz.org>
>> ---
>> fs/nfs/direct.c | 9 +++++++--
>> 1 files changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
>> index 9943a75..bab4185 100644
>> --- a/fs/nfs/direct.c
>> +++ b/fs/nfs/direct.c
>> @@ -45,6 +45,7 @@
>> #include<linux/pagemap.h>
>> #include<linux/kref.h>
>> #include<linux/slab.h>
>> +#include<linux/task_io_accounting_ops.h>
>>
>> #include<linux/nfs_fs.h>
>> #include<linux/nfs_page.h>
>> @@ -939,8 +940,10 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov,
>> goto out;
>>
>> retval = nfs_direct_read(iocb, iov, nr_segs, pos);
>> - if (retval> 0)
>> + if (retval> 0) {
>> iocb->ki_pos = pos + retval;
>> + task_io_account_read(retval);
>> + }
>>
>> out:
>> return retval;
>> @@ -1001,8 +1004,10 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
>>
>> retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
>>
>> - if (retval> 0)
>> + if (retval> 0) {
>> iocb->ki_pos = pos + retval;
>> + task_io_account_write(retval);
>> + }
>
> The async path always returns -EIOCBQUEUED. How are those bytes accounted for?
>
Oh, thanks. I forget about aio.
So, there only one option -- always account whole requiest before completion.
>>
>> out:
>> return retval;
>
> --
> Chuck Lever
> chuck[dot]lever[at]oracle[dot]com
>
>
>
next prev parent reply other threads:[~2011-02-21 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 19:15 [PATCH] NFS: account direct-io into task io accounting Konstantin Khlebnikov
2011-02-21 20:17 ` Chuck Lever
2011-02-21 21:27 ` Konstantin Khlebnikov [this message]
2011-02-21 21:28 ` [PATCH v2] " Konstantin Khlebnikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D62D8C4.3030004@parallels.com \
--to=khlebnikov@parallels.com \
--cc=Trond.Myklebust@netapp.com \
--cc=chuck.lever@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox