From patchwork Wed Nov 1 19:53:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 10037031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1C74603B5 for ; Wed, 1 Nov 2017 19:54:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D145C28B89 for ; Wed, 1 Nov 2017 19:54:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5BE728B8B; Wed, 1 Nov 2017 19:54:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D914328B89 for ; Wed, 1 Nov 2017 19:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754865AbdKATyL (ORCPT ); Wed, 1 Nov 2017 15:54:11 -0400 Received: from mx143.netapp.com ([216.240.21.24]:12952 "EHLO mx143.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbdKATyK (ORCPT ); Wed, 1 Nov 2017 15:54:10 -0400 X-IronPort-AV: E=Sophos;i="5.44,330,1505804400"; d="scan'208";a="225447617" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx143-out.netapp.com with ESMTP; 01 Nov 2017 12:23:38 -0700 Received: from VMWEXCCAS04-PRD.hq.netapp.com (10.122.105.20) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 1 Nov 2017 12:54:09 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS04-PRD.hq.netapp.com (10.122.105.20) with Microsoft SMTP Server (TLS) id 15.0.1320.4 via Frontend Transport; Wed, 1 Nov 2017 12:54:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iVzfXs3Ux1dvlgnqjaM7QK3DzEtSD4WStmH4zkiHYHw=; b=X6zPjr5dNXRo/u5nUR4pvAM8TJRHItB+Y1DPiydxLje19bYCE1RDfqsstEhsisQL8c3Cen3GZiGxIKfeVZ6mSDM8PmPWqu68AXEko8tmRY+K/J4dkwena9l2DrSRGnDmmQjETIANyoEGpa5/sqN1s6cw9xc2POTBm6vSXlOxoD4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anna.Schumaker@netapp.com; Received: from gouda.nowheycreamery.com (68.40.188.1) by CY4PR06MB2471.namprd06.prod.outlook.com (10.169.186.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 1 Nov 2017 19:54:07 +0000 From: Anna.Schumaker@Netapp.com To: CC: Subject: [PATCH] NFS: Avoid RCU usage in tracepoints Date: Wed, 1 Nov 2017 15:53:51 -0400 Message-ID: <20171101195351.13881-1-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 X-Originating-IP: [68.40.188.1] X-ClientProxiedBy: YQBPR0101CA0060.CANPRD01.PROD.OUTLOOK.COM (52.132.64.165) To CY4PR06MB2471.namprd06.prod.outlook.com (10.169.186.139) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ccf0e57-c2c3-43ba-0aa9-08d521625063 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:CY4PR06MB2471; X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2471; 3:GtRGnR4R7BtwUI2LX9z/VN2zicw4GiLR1Tepsrg7jp//RSx5CaqL3G55e1IqDbe2XUHEAS29xRrCIu2vB2BAp6aLdwMJ5Nh3N5E9m2YYq3SDI65aj/h5OlGZtOTzIT9VZk9RGD2USkIiZ4G9D++zJbOgi8Z+lXGNG63/zVmLrvgqDjU2U0hei0KX5rj+oB88MpTUNOdD5avhkpjBbwe2aKzdCUuj87Z8udopklDt1rVchcR4IppxoOlt0JJMox1w; 25:XXO76gD4SVa47V0UznbAfg+fY2YfiHIh9atDk7MWj7FBQWkSnBEmCwP6PVaeuBujFHh0XGiQUo8BX1DHr5Xjjkxy9VSnLuuMoWrpMwn3WerNoU8r3ycAFoq4krcZQ2ZQWWC5sAui+R9VdYfkXaItrSBXDrg8cr4bV29TFQt20+xtyj21IWJEphtFpROeqmIiHdLQqPCUagcGtQLkhX+KEjxo2v5Wslpg+j6BhA/mdGmNbpEf6ZuM4x9rgMdGzlSO7FLkvHhj+HiMT90N2gOGpEu3TdLm9RHdjgRLm4RX3Z/lymkFaJs8gOvZ3ui9ThpY7mw3BuXZChajlDfBqQIOag==; 31:w0J8i/c9wtPa0I/KlX9lw3WnwTnzW+gxUdT6fU6TPF9CNosZ4X8f+fBqOb/WlD1d8C7+JrJoTGdEv6ac2o+TTdzcvdqaDx2AemuBkU6bhcNCgoNxJV5KNwWr4u1qAWtkGlt/dk1cQ1KLArstQvxu35A+M/a4lEwZoTbypcZ/ygCNMp0qx3dwJ5vr/Fj4rBRAxTaITj6+t5VxDiagGGd8HggR6MKUA8zLSfi04ySPzNw= X-MS-TrafficTypeDiagnostic: CY4PR06MB2471: X-Microsoft-Exchange-Diagnostics: 1; CY4PR06MB2471; 20:+se4YM5gJTx7kPwBwiuLkGVg09uAAoDsI5Xc1Y83+97qPtOGzJoBgBQ/3nlJ+aBwsHB4bLrrUtm0n2SrEFXOuBQMuZ5h3nk7Sv9qQXAP7HC6L6oW9zkwRmeyGVhxnU9PvhrIAO4cbVPyiuZKLeFDaS76Z+4wnqYphAGRgBZ+ZQAkB87lMKYPSaHCQjlmiv5qF0BDZiVsy4F7peyirAcoi2bgm5GpcWUkJNpvVIrOU3rnQ454882nMGDULIFnSE/Z8M9/vd2yVpZ55/S3yqASvSPlBgGWPToU3tRXyeHQMCMRU3E/ghZDFcOXiqZvr8QgAuI53zhVC6543EQnNwukYoTUq5G6HkIPXQxueWYlYEjagDHbsJmq1CcU7fZVXQqJLIx1jzpLWTk2pB7d9PH/LOlRzmB6KLT+5xcY6vrFRTKYvTiO9P2JWYkzhDlfQV2phQXYtA0maF1PUyHr4HxCghFIBDX4AN7Uoc8AVDNEdSF0tThvGMitLWLu0LSFI6tm; 4:vxM8irxk4BM4oMpV7z5ppsP4kUGrd2ZwrDH3hEQzwaymKRmhdH4+uYySLA00ix7AbQnLW2FXCK1rzJ70mgCKfgSDhsYkMhFA6WV5radfN7+luun8NATTzUf4dxBsUTcc5LcwVZtvo4OyfMF6mjhGF8LCUwnZ+X+zBBDg5oOs1hOVegkcvch/gT1Kx3GZW0VpfAP4lRP02vL+mrqXqWDCVjQkevpIktjj73NyatRJBd8v63c21i6w2w1MgY9hIi5QgOXQVwa1DoVrz2x6tSvwzA== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(3231020)(6055026)(6041248)(20161123558100)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR06MB2471; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR06MB2471; X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(189002)(199003)(25786009)(16526018)(5003940100001)(2361001)(50226002)(72206003)(53416004)(7736002)(105586002)(305945005)(2351001)(101416001)(478600001)(50986999)(50466002)(48376002)(47776003)(106356001)(68736007)(9686003)(6666003)(4326008)(6486002)(6916009)(6512007)(2906002)(316002)(97736004)(16586007)(5660300001)(189998001)(53936002)(3846002)(6116002)(36756003)(8936002)(66066001)(86362001)(1076002)(81156014)(81166006)(8676002)(69596002)(85782001)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR06MB2471; H:gouda.nowheycreamery.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: netapp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR06MB2471; 23:ntac01YUkQUi0cekiE12D96xLP2bqi3yh+wtMH1Ff?= =?us-ascii?Q?uGPIVXUoeWBpejXEDzG51NFy3F+M7v/Gidlyc+AZSbG9FbL2Wt+2pLaOZOve?= =?us-ascii?Q?TPSh6KX+Ul6+VhMUm4oe+DqIJMBYjSka8rA3q1pP4VSLxpzY2FlKT/vQgaw+?= =?us-ascii?Q?ksCmUYndnpnWjTiujasbPPL8geCAzeWq2a/L2KVjG2qfaw9HO7Ngfj82HqoA?= =?us-ascii?Q?RfiWZh77j1229fTvgMLdQcQxFlOXdR4A81ke2kB1tQVlKsffp0Rwryz6f3p5?= =?us-ascii?Q?9skcjI5FnuOBoTjsmPFZ83CjpphjcJ+mJazvGqXpjy1ymGSY85/8rfypZ746?= =?us-ascii?Q?koOiisTPKJ4kWLVcFcDAkgAWmVMdqP7byDIaV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U9sISzaXI443mJhVEIoHt57755lorglQc7D24Uoy4RxoOBIk5Ss+3Ol9kBWcQKgjnE/fQl3czqVJyjK19Y8Ddyfv5KddZxg1O8MjkIuzi1/RHsG6r4YUZkOuua32n20pofzj15LZeIF75nI2qh4//0DA7C8z2raRTFDesqUSeaWZWuxoOLFvT2oo32mO58RzNHh9i0f4u9hMQFKyqWSYgP2EGJ3dnF+AipttXN5RvIjlEt6Uljn+mHi2ggkk5XcHbLtLclDXJfeMhzHAtBnlL9rVNMi9kPd4sRgaAIFlPnOhVrA0A49Vo=; 5:2vg3hjutyGRvK8h4+/yjdiurjF1g3oLtccuw9slB6sgogkwlngspYj9nNlBS6V4GgircBe2rRjGY/2PDHZtGaPI77byA4m9hmzVV2Ab8AYuZxNaG11UhEAYa9UBDlwEoP0h+ipp0JCqaqzX+bkDxBWFTJoo2jpULUxL+CnRxPyc=; 24:M9tNAo9P/PoFho/7lglrWxFe8+7soEu3zEY4LtmWrspTvK3JWHsPRUIcc+gVRvs4/gxJAoVcuezlWiEWtyJP4UUeF1jF3QQbnIuXdfkGlEM=; 7:WyDAhJCuA0OnzyDUNsDoxmjbBuym5kB9C/TSjhxeI0GYzjyAsA0zO34eGlikY4/dOSpfN9FbqFB5myPMJhhrBKM/ZJHHWlbT7AEnY9wqMfKKNsclgqYHFeGcoN18CkgzFE2NQ2mcuco7KhHircnYzIB8xZdjXgy0s1lkr9LF2L+LgQKkcVlRjaQ9WhFbWOYYZGee/pssSK6bQ678QsHujtNPyT3OvU9/qRzpaUzAB2nhFsg9dNrLsVarDHTIzKrK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 19:54:07.8066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ccf0e57-c2c3-43ba-0aa9-08d521625063 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4b0911a0-929b-4715-944b-c03745165b3a X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR06MB2471 X-OriginatorOrg: netapp.com Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anna Schumaker There isn't an obvious way to acquire and release the RCU lock during a tracepoint, so we can't use the rpc_peeraddr2str() function here. Instead, rely on the client's cl_hostname, which should have similar enough information without needing an rcu_dereference(). Reported-by: Dave Jones Signed-off-by: Anna Schumaker --- fs/nfs/nfs4trace.h | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h index b9962d93e746..06ac7156c44b 100644 --- a/fs/nfs/nfs4trace.h +++ b/fs/nfs/nfs4trace.h @@ -201,17 +201,13 @@ DECLARE_EVENT_CLASS(nfs4_clientid_event, TP_ARGS(clp, error), TP_STRUCT__entry( - __string(dstaddr, - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR)) + __string(dstaddr, clp->cl_hostname) __field(int, error) ), TP_fast_assign( __entry->error = error; - __assign_str(dstaddr, - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR)); + __assign_str(dstaddr, clp->cl_hostname); ), TP_printk( @@ -1134,9 +1130,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event, __field(dev_t, dev) __field(u32, fhandle) __field(u64, fileid) - __string(dstaddr, clp ? - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR) : "unknown") + __string(dstaddr, clp ? clp->cl_hostname : "unknown") ), TP_fast_assign( @@ -1149,9 +1143,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_callback_event, __entry->fileid = 0; __entry->dev = 0; } - __assign_str(dstaddr, clp ? - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR) : "unknown") + __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") ), TP_printk( @@ -1193,9 +1185,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, __field(dev_t, dev) __field(u32, fhandle) __field(u64, fileid) - __string(dstaddr, clp ? - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR) : "unknown") + __string(dstaddr, clp ? clp->cl_hostname : "unknown") __field(int, stateid_seq) __field(u32, stateid_hash) ), @@ -1210,9 +1200,7 @@ DECLARE_EVENT_CLASS(nfs4_inode_stateid_callback_event, __entry->fileid = 0; __entry->dev = 0; } - __assign_str(dstaddr, clp ? - rpc_peeraddr2str(clp->cl_rpcclient, - RPC_DISPLAY_ADDR) : "unknown") + __assign_str(dstaddr, clp ? clp->cl_hostname : "unknown") __entry->stateid_seq = be32_to_cpu(stateid->seqid); __entry->stateid_hash =