Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4048102ybv; Mon, 10 Feb 2020 11:16:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxYMZEIHZCOLJiMCBnV2or2BQwtABfFuj2hi/ffNlGbbLD2uzF28SA5Zqj5NdtVeeVG/nyp X-Received: by 2002:a54:480c:: with SMTP id j12mr366299oij.130.1581362189640; Mon, 10 Feb 2020 11:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581362189; cv=none; d=google.com; s=arc-20160816; b=m3EXJ2HnQ8QtmjPD3lhB3yLiNW8tJLWG5O5k7txoaOCgPNVlgpCa+CMu/x9clWE0tr l+YDN4t1sE9r2pMjNNGcl+BeopxibNmM21Ax0i4O8hdStCR5CWL7X2+Rq7EXhuargMj7 I7VhRKUTcXrSam6tMH61cAO4MTipVorX+SqElWLJCBRNxHfawNLbHg+zoqSK+eZ3+mIT EJVrWROgxjWLcBEl+ia9goUdldSy1Smt9KkC2fVVOrRIbuHsw1OWyQSwBKZezpHkspON 9Czm9trfomZ4oqEOs3U7KC4hZaisT6iJ6L2/qS5KWupvrYsUm8K7OwwKbel2h+riIriW mLCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bX+88Oqr9VbMzymWapnmRWOT+ucgpVL7mFGX75Ly+eA=; b=LT0HN1pSo/K6ymO8gqfUHKieRxC3opTetDOPTZTrXaF3rhDouF073Onb3beWe98OMD Df7Z636ZOmtZcAa59Eu45mndD7xcwah/OoHGkmB7MXYDprSoR/hyGJ0BOx9FLP4IvaeO JH+leR8Yi4vVD9d4DUzB1np0F41aCJGLf+zgSdRJwjcpY3OTWYXnjv6gNgVnl0S06SJo n/bK4XkBbmD3gfg+zFxnsp8qAwMBQSfUTi70Kp3E3yoSoMTpeRgdZqFmg1DpBbM4ZUMe WXDbHsSXHfMUjnHxNtVFH5Vq2h76qGM2PnkPhGKQmbdcYkOqX6B+b5CL2x4nX19CmyvI NQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/4dgZhF"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t70si513803oif.99.2020.02.10.11.16.18; Mon, 10 Feb 2020 11:16:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="g/4dgZhF"; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727575AbgBJTQL (ORCPT + 99 others); Mon, 10 Feb 2020 14:16:11 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:45424 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbgBJTQL (ORCPT ); Mon, 10 Feb 2020 14:16:11 -0500 Received: by mail-yw1-f66.google.com with SMTP id a125so3929597ywe.12 for ; Mon, 10 Feb 2020 11:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bX+88Oqr9VbMzymWapnmRWOT+ucgpVL7mFGX75Ly+eA=; b=g/4dgZhF3gRGIk6czUZMOpVH5c0zuV6I5x7NptBcX0l0BYUtO3xKQNVJPLvlG9DEeu Q7OCzUgbH4CdWI2C1bac76ojrwwe0OKeiexeAtr5VLVyVnlCkwgcit8GxGp4Wvv+cHly TalQdJRmRnTH+B4PaqdUeOg7D5iq2ixSnINhEaYVBZ45xZT9s/YmllXgWzAXp+58i1f5 MCYW4FDzcnRh4Oa2LUJc3yUsSRiudeXdIfWdAxFrZFJh3GSA3NhGxbDxmTwIAdtPjBg6 LJHpxCVH8IqlHcd/8ojhwc3fWvc+2007ZY6u52waQk65mpXhOWfJ2+R2bv8BLU1OdumI Gckg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bX+88Oqr9VbMzymWapnmRWOT+ucgpVL7mFGX75Ly+eA=; b=cXlHf+Q05QjCyt06ZMClhOZErwyJpSuJyyPqf4cIzgMHdurVHzt+TLbK0+MhJvnSUr FMyaE88OWGXHgSInosU9lN2BkFKZmeOT6YVqhxcpf1t04KBU0VqZmLEign7wf+OCAzs2 srSQjDO0tybuK/kAt+yM7IhumZ+hVrtGnbOQ1McF+TI5JEhuKbXhJ/1sgo4vHKZuQGjB EyXDyyzT83a06/LLNSwYDzPWtQrpkcHlS9DH5PqNLQJ4WS0Wnab1QZ5veBLcog9EDZ47 GMLd3HKISg9sRyHPyqpKF3YDybViWdmYwJ9DqI99C6kcS122Z3rohJxd9OgeiKsIJcgr ar9Q== X-Gm-Message-State: APjAAAUsr3kJVHLJsy6KQXC45WVoDynM+RXv8IZ+yy5pdEaqWimWBjuf PqWshoWeFGQ5+NtW1/NtWOsOCZHIWg== X-Received: by 2002:a0d:e20a:: with SMTP id l10mr2251695ywe.17.1581362169562; Mon, 10 Feb 2020 11:16:09 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id o4sm660222ywd.5.2020.02.10.11.16.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 11:16:09 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 5/8] NFSv4: Avoid referencing the cred unnecessarily during NFSv4 I/O Date: Mon, 10 Feb 2020 14:13:42 -0500 Message-Id: <20200210191345.557460-6-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200210191345.557460-5-trond.myklebust@hammerspace.com> References: <20200210191345.557460-1-trond.myklebust@hammerspace.com> <20200210191345.557460-2-trond.myklebust@hammerspace.com> <20200210191345.557460-3-trond.myklebust@hammerspace.com> <20200210191345.557460-4-trond.myklebust@hammerspace.com> <20200210191345.557460-5-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Avoid unnecessary references to the cred when we have already referenced it through the open context or the open owner. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 00fe674c8a49..47464fb419dc 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2346,7 +2346,7 @@ static int _nfs4_proc_open_confirm(struct nfs4_opendata *data) .callback_ops = &nfs4_open_confirm_ops, .callback_data = data, .workqueue = nfsiod_workqueue, - .flags = RPC_TASK_ASYNC, + .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF, }; int status; @@ -2511,7 +2511,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, .callback_ops = &nfs4_open_ops, .callback_data = data, .workqueue = nfsiod_workqueue, - .flags = RPC_TASK_ASYNC, + .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF, }; int status; @@ -3651,7 +3651,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait) .rpc_message = &msg, .callback_ops = &nfs4_close_ops, .workqueue = nfsiod_workqueue, - .flags = RPC_TASK_ASYNC, + .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF, }; int status = -ENOMEM; @@ -6350,7 +6350,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, const struct cred *cred, .rpc_client = server->client, .rpc_message = &msg, .callback_ops = &nfs4_delegreturn_ops, - .flags = RPC_TASK_ASYNC | RPC_TASK_TIMEOUT, + .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF | RPC_TASK_TIMEOUT, }; int status = 0; @@ -6933,7 +6933,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f .rpc_message = &msg, .callback_ops = &nfs4_lock_ops, .workqueue = nfsiod_workqueue, - .flags = RPC_TASK_ASYNC, + .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF, }; int ret; -- 2.24.1