From patchwork Wed Oct 3 23:08:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fred Isaman X-Patchwork-Id: 1543891 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 253E03FD56 for ; Wed, 3 Oct 2012 23:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932585Ab2JCXIs (ORCPT ); Wed, 3 Oct 2012 19:08:48 -0400 Received: from mx2.netapp.com ([216.240.18.37]:8749 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932497Ab2JCXIr (ORCPT ); Wed, 3 Oct 2012 19:08:47 -0400 X-IronPort-AV: E=Sophos;i="4.80,529,1344236400"; d="scan'208";a="697053718" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 03 Oct 2012 16:08:47 -0700 Received: from localhost.localdomain (srinathk-lxp.hq.netapp.com [10.55.76.130] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q93N8kWx027603; Wed, 3 Oct 2012 16:08:47 -0700 (PDT) From: Fred Isaman To: linux-nfs@vger.kernel.org Cc: Trond Myklebust Subject: [PATCH 1/1] NFS: dont revalidate the inode when using local locks Date: Wed, 3 Oct 2012 19:08:44 -0400 Message-Id: <1349305724-28173-1-git-send-email-iisaman@netapp.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This drastically improves performance when using lock-heavy workloads that are amenable to using local locks. Signed-off-by: Fred Isaman --- fs/nfs/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index a6708e6..fd0155f 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -765,7 +765,7 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) * This makes locking act as a cache coherency point. */ nfs_sync_mapping(filp->f_mapping); - if (!nfs_have_delegation(inode, FMODE_READ)) { + if ((!is_local) && !nfs_have_delegation(inode, FMODE_READ)) { if (is_time_granular(&NFS_SERVER(inode)->time_delta)) __nfs_revalidate_inode(NFS_SERVER(inode), inode); else