Created attachment 440733 [details] [PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O [PATCH] NFS: Too many GETATTR and ACCESS calls after direct I/O The cached read and write paths initialize fattr->time_start in their setup procedures. The value of fattr->time_start is propagated to read_cache_jiffies by nfs_update_inode(). Subsequent calls to nfs_attribute_timeout() will then use a good time stamp when computing the attribute cache timeout, and squelch unneeded GETATTR calls. Since the direct I/O paths erroneously leave the inode's fattr->time_start field set to zero, read_cache_jiffies for that inode is set to zero after any direct read or write operation. This triggers an otw GETATTR or ACCESS call to update the file's attribute and access caches properly, even when the NFS READ or WRITE replies have usable post-op attributes. Make sure the direct read and write setup code performs the same fattr initialization as the cached I/O paths to prevent unnecessary GETATTR calls. This was likely introduced by commit 0e574af1 in 2.6.15, which appears to add new nfs_fattr_init() call sites in the cached read and write paths, but not in the equivalent places in fs/nfs/direct.c. A subsequent commit in the same series, 33801147, introduces the fattr->time_start field. Interestingly, the direct write reschedule path already has a call to nfs_fattr_init() in the right place. Reported-by: Quentin Barnes <qbarnes> Signed-off-by: Chuck Lever <chuck.lever> Cc: stable Applied without changes to kernel-2.6.18-194.0.0.0.4.el5. Signed-off-by: Chuck Lever <chuck.lever>
Looks like an obvious fix.
I've put this patch in my test kernels here: http://people.redhat.com/jlayton/ ...if you have a non-critical place to test them, can you let me know if they fix the issue?
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
hi Jeff, Could you provide test steps for the bug?
in kernel-2.6.18-246.el5 You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5 Detailed testing feedback is always welcomed.
do code review and verify patch is applied in kernel-2.6.18-262.el5 as per comment #9, and do some nfs regression test using O_DIRECT, test result recorded in TCMS: https://tcms.engineering.redhat.com/run/21467/
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-1065.html
Removing external tracker bug with the id '00317700' as it is not valid for this tracker