Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp846525lqe; Sun, 7 Apr 2024 06:43:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOqvubIbdacx9ZmwHhclf9mP/yfZhBvJy1Bj24KlmvBZuhAPCnOo8GUCiN17ChJWQObbzcrGCsC71Uhd58iH1EpL3oDmT56wqZJVBF1w== X-Google-Smtp-Source: AGHT+IHgErQl9Ftjs9qK8nApjzqRDnriSGhwjX2W+j6ur1ySfesC7nvhrk78T5E30SpMgRmvQsxH X-Received: by 2002:a05:620a:4687:b0:78d:661e:6b32 with SMTP id bq7-20020a05620a468700b0078d661e6b32mr364961qkb.74.1712497389023; Sun, 07 Apr 2024 06:43:09 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dt35-20020a05620a47a300b0078d5e4de0f2si2737716qkb.176.2024.04.07.06.43.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 06:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rutgers.edu header.s=selector1 header.b=FWQKdn97; arc=fail (signature failed); spf=pass (google.com: domain of linux-nfs+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rutgers.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A7D231C20FE8 for ; Sun, 7 Apr 2024 13:43:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 150CF381D1; Sun, 7 Apr 2024 13:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rutgers.edu header.i=@rutgers.edu header.b="FWQKdn97" X-Original-To: linux-nfs@vger.kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2126.outbound.protection.outlook.com [40.107.223.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62BE83771E for ; Sun, 7 Apr 2024 13:25:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.126 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712496337; cv=fail; b=Se6hhuDAmO/AeNwZVw8ACgZseXrZfOLys/AOEaAz+VCemH7BBTH/ELDpe+YcplFRB3cTcWTa1N7NA+L/RmxQI3SFWDeBVAn4wVdkk3k7Z6ENLiZamtabVhXFJfRlJQYVVVRWIMkuVnJMN7AgIURBdP4iTc3/yGO3pPIMNNXAu+c= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712496337; c=relaxed/simple; bh=GomWBosHBvC3VHH4ytKCuFQ2nW1TOWAVI2pULfniXEQ=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=OrACc5QduPWsKyzXKmY5lcn3l11lx2oeTDuH/g2CtgjkEwj9OpR1o7pXa0gy267vpA5bG/WA8PHKxbLX2zCV7rDApsUufCjUCJNu0Jf6+SkRJBPZMLvGKqu/IR9FA+V+Vyu/PDsPcXmw2Qs3XVSySxPOcRnXOSPJSxUCVAIQaL4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rutgers.edu; spf=none smtp.mailfrom=rutgers.edu; dkim=pass (2048-bit key) header.d=rutgers.edu header.i=@rutgers.edu header.b=FWQKdn97; arc=fail smtp.client-ip=40.107.223.126 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rutgers.edu Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=rutgers.edu ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TLcmOE5ZkzyFGmAPM1wFHUJFgMj/yTmUtcwXKYSr6bntn/ywt0uV4YlIC4T73ICPr+F+ShP/HFMaLfcdATVKV2wXRm07l7gTbUNC5w6995wzi7BIh+ukGqHlorVO4QquSEbOaeyZw2t0Yk/hlX6WvCbTW4QL+A2EdCIQOI3isgD/r2707pObOo+qE4jGtgedlRqktLsgKZn3FjMoHr3JFcSGxvCjHx9wQnae30P2dujZTqpCNywQ7vRLGENJiaYw59aEfptllsLh9ZGZ7L470kJx6eSYxQB1Uuuwz+JJR2JQyPYibNwgpI5OohuoApbm6BJYfB5IO+P9Ma45v6uICA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GomWBosHBvC3VHH4ytKCuFQ2nW1TOWAVI2pULfniXEQ=; b=PPkTAKgRomV/Ck14prNrGrjiC1tUAHaLbOs6Sa9YRxulUdu2sM+/iAvnVkLbmwiw6fnmpGPjeAGnnzSwRIhvZsZKsbPn1QWuNNmbXZj6jK2w0GkCQ1hn3TTTMybD+kzKHf4qjcoEJ3sorDFjw29XR+RMn8qHcK4FkS/PpIb5Uo+Okewf6xutV1r6viFq0d7hl+1DzdQdsRqlaWh5gDWvswIi4fc5n/cKDtQcoSpiAT3wZNYy5buq/7gilmEUNsjB/A5fWuFMwgabaLl/aocUpWUP4jrRqxLtro7pkV2YOE/vv1IS0sOmnQznERVXVgxOz9upOb3cYJXQ0yiAG2/fzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rutgers.edu; dmarc=pass action=none header.from=rutgers.edu; dkim=pass header.d=rutgers.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rutgers.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GomWBosHBvC3VHH4ytKCuFQ2nW1TOWAVI2pULfniXEQ=; b=FWQKdn97jKEuCuq9b+o7ImutUtg4XpzmjRO6d0M46rCiHruJUaquhgIye4IbU0Vx4rhBuESjBf6sHXsg0e5K6FM41Q+aA0dHzRUMP9HRZ/QVE3/cgWJaXqq3aOgyE5xDmf5WDfypprjvlVEIfZRIb5+/honvcOWxa2s8g3BOLD0FVwYq8lH1pR1dTnfAmFrJho7i5hCphSqDEL0tZJPBEsKGQKh1SE27wgw3RWVnnrF7kYyFyKPlzO8nrKzhWhXeNtu5ii49lglGEl4daTF/v1rcmFPEAwW1IO42FT33y9J2hX5m8GZGXc5irZ5ykVJgLbVsoEFxSTfzAz4kzRWnmQ== Received: from PH0PR14MB5493.namprd14.prod.outlook.com (2603:10b6:510:12a::11) by SA1PR14MB5476.namprd14.prod.outlook.com (2603:10b6:806:23d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sun, 7 Apr 2024 13:25:33 +0000 Received: from PH0PR14MB5493.namprd14.prod.outlook.com ([fe80::ae8e:c5ab:50fb:ed4b]) by PH0PR14MB5493.namprd14.prod.outlook.com ([fe80::ae8e:c5ab:50fb:ed4b%3]) with mapi id 15.20.7409.042; Sun, 7 Apr 2024 13:25:33 +0000 From: Charles Hedrick To: "linux-nfs@vger.kernel.org" Subject: optimization for nfsd_set_fh_dentry Thread-Topic: optimization for nfsd_set_fh_dentry Thread-Index: AQHaiOz0yLe16yGdgkeM/Wdo4AR5CA== Date: Sun, 7 Apr 2024 13:25:33 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR14MB5493:EE_|SA1PR14MB5476:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JBURbRCLUZAyumqrTiMl+yLmLYegwm5Oh2Q9xOtD9H3oatNazEmU/5MlElEtXXrZbK2fCGCLD/kq4kbem+GVFW73ytnOxGhD5CIGJUZ8byRbHSip8GxuiI4x5Rrfy4E6NvaDOpHhnDscln5tea0xWKXwATo/QhRKu7MScUJnYEjbsQWVs/cP2knXmSgEmKqLi+XrqKr8b70EiqwwIELACw9Oi+ij5cAnovu1lIpQ8eMPURPJEP9uJYui4qRgBDZfL4HWKr2RB5lGk9PqhzCk5tvgAAv/0zNExAYUu6YsyG3Z0wW5c6RcvpkiAALABi9ps09DjKxCZBwzQrpp+YyHdX0EewTzB8s+nMAIRHew5Dp/DSTjKRPhv9tcSn5SINTPiC7xsI6odKPGuwf18yb7RyeEOBgaw+kcVOfzg6cxKxTP1VO0doaUjxGXd0uzueFW8bgdC6//VVV7nPiU8i46aZNju/IX1AjPWfXZkj8oSaJu+gDpZ4Cf9p+RD1KZU17kLB2cmbqmE0t11XAjBFv0J84NJ2haxk3RxExVEttaiQPXI4gcoqgJkX6eyPPcJ5oychmwc7U6Hdy2UyFx0Xy5+76fzwt1ushrdytml09ZpHjEHUYnHNU8DhTe+ERdC5cTMXBK7zXVtO5Ur+khZ00FtQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR14MB5493.namprd14.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?gC067X/5cTwzNEDwvITtfjVca870Sl++xxU6qbQaeOoYaruAbm/6FO8k98?= =?iso-8859-1?Q?IYVYHrhSBSgwXx5YnVOfoj9JZ4ahNPPdHR0MjboeJAvIv2iXlChHXWDkF/?= =?iso-8859-1?Q?SmKoJt148Y4YzST56SlPRBdfx/MhczpLVaRbylj839kQFTC1Eci6B0Er0v?= =?iso-8859-1?Q?hKGAMh/6H5f9i7aVYxX6mHcV/s8CHeYw90SiL42JXfNHz5RClvf+t1Ugvf?= =?iso-8859-1?Q?7yY3rKfYmrasaPqsXYfIebvDS7VABGAvE2HhcKkYHMRCXzqvoasOCF4m0L?= =?iso-8859-1?Q?mGEu/FaOjwGT0JSS7Rt9ECCc+wB63piPzBwasMP3Sff+TpPv01q6tWFqsN?= =?iso-8859-1?Q?zFiP3NIB2ETrMbNr4aQtANXHa/2frO39dUCITaJIaR0pdGFkfrE6F6iSo+?= =?iso-8859-1?Q?VpGM/zK6yq5+ZY3/l4Ai2TENzSMWVKbAiKJASLeQaLdvKz0KKF/0mreMDu?= =?iso-8859-1?Q?IhXpBrAjm2jII3n0vYZKNBEcVEiFY4wZWRVqNU+7uF9cQ7y1E/lxF66tFr?= =?iso-8859-1?Q?y2UTrbjtwDHyTDCTyPk140kGQnA4TBtAgR/DSydlFp5QCVRxMEsOuCPRpp?= =?iso-8859-1?Q?RhY8AoWIKK3g2ThgaZ0kf+VA2nINJMvVEvOAtCF4EcPrNuvCpVT64xvrS1?= =?iso-8859-1?Q?bjb31jgfTc+oLBS+UKYZzhFASU/iZkQ6Esjl1PsqMqAXYryUuYKqKSi1ON?= =?iso-8859-1?Q?9emZmljA/Ks4mV7Rb7E1Jvuw5/qYx/4L3Q1ZsadxYQXT7kdcvBrEd6rDin?= =?iso-8859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vPcmwBc?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: rutgers.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR14MB5493.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 539b5b27-4bbb-4ba3-05e3-08dc570633e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2024 13:25:33.1873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b92d2b23-4d35-4470-93ff-69aca6632ffe X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: R85maRgKigBeWdHlivpU5pEqRSSWz+fgElAV3mzx7Mj80kVilV9OaHkFwEaPUTr1YgpkV7vtlhQdJzlS1YfP+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR14MB5476 nfsd_set_fh_dentry is used in setfh and a number of other places. It calls = exportfs_decode_fh_raw with an argument nfsd_acceptable.=0A= =0A= That is a test that always returns 1 if NFSEXP_NOSUBTREECHECK is set.=0A= =0A= However there is an optimization in exportfs_decode_fh_raw that skips a lot= of file system stuff if NULL is passed as the test. A test that always ret= urns 1 still triggers all the file system stuff, even though it's not neede= d. =0A= =0A= nfsd_set_fh_dentry should pass NULL to exportfs_decode_fh_raw if NFSEXP_NOS= UBTREECHECK is set.=0A= =0A= I discovered this while looking into a performance problem caused by a path= ological client that was sending 40,000 RPCs/sec, almost all get =0A= GETATTR or ACCESS. It was causing the nfsd's to be stuck at 100% CPU by loc= ks in file system code invoked by this unnecessary code.=0A= =0A= (We fixed the client by mounting with NFS3 rather than NFS4. This suggests = an issue with the NFS 4 client side. Unfortunately I don't have enough info= rmation to make a useful report.)=0A= =0A= =0A= =0A=