Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2987301rwi; Fri, 28 Oct 2022 14:08:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5eQDkmsUHXyQua+gxRnpQRRxYJz/rM0pE5HvOFkV0rj4dO6fiXd5dW6PIDPU9iGMoeUEvL X-Received: by 2002:a17:906:8a65:b0:7ad:88f8:7ecc with SMTP id hy5-20020a1709068a6500b007ad88f87eccmr1054510ejc.535.1666991307018; Fri, 28 Oct 2022 14:08:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666991307; cv=pass; d=google.com; s=arc-20160816; b=wFaOCyfhAeyX5QdHU2vv3El0e0dXQyZ/B0RrXIYUXLPPszAoDGrGVrYMFQd1skzyx1 rrF8JyB5MXNs5aKb6NEaMwsDdAjYvGvA6Xv1QQQqouhsuanqGdk/uk5DPavjVeICsbCf PqV9MuxZJ0B8qZk6AJIydifgy8gQoOqnju6AIpHU68SoAk6MHyVz6CTj/6Kt10AcaIvP 4d4HTm0H4uFoNuFFHA7gSXVskGQrWUGd8qUuelHOckGAb85WO3KukzpU7lrmM4y3A4XW Lvc1Tn5xtOSMEgtvWXoR1EkvA1sZVqH1S685XTOC6NDqynRNd2TwuSWq9hoMDB7yTs6q kiiQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=G+P6y0xg5d0XwQE3uD/+U8YtPy1u4zvrcgtQISkIur8=; b=IdunmaQy2hHyRS/AI5fE/PgD5N/L6g8qIdv2pCtQWTCVSWRkEsJcsSXkL95cyh/pN7 P8NNe2LlSQFvf0OJWUaw3ftLNADmgknZCRegHp0mSveX+dU76mQSaG1Sjndv7LMuKVzq ZtgaML8F5GEJIQV7nmQkrOUewRD5O2KWGOoOcXhBfRODrnDHvBdp5obau/6DVojUJLCX UU9eSDIfx2Nu6PZIstD+9Q7SUNHJhTFsSfAhYcVXd1Ky0fssdlk+mYP7TqkzzUVoGwMH YthYEjSMZ2lLVhN9RilSJDPf193jOkT/7cRd5HEUNfW7IJoLN8EEwMp0+2xDrsfsV3kL t2ew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=bHqA3kk9; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=O+FRV1HJ; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc18-20020a1709078a1200b0073146b3f95asi2545843ejc.632.2022.10.28.14.07.57; Fri, 28 Oct 2022 14:08:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=bHqA3kk9; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=O+FRV1HJ; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiJ1U61 (ORCPT + 99 others); Fri, 28 Oct 2022 16:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbiJ1U5o (ORCPT ); Fri, 28 Oct 2022 16:57:44 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F128247E29 for ; Fri, 28 Oct 2022 13:57:42 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29SKSlGe011551; Fri, 28 Oct 2022 20:57:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=G+P6y0xg5d0XwQE3uD/+U8YtPy1u4zvrcgtQISkIur8=; b=bHqA3kk9zgHz3b/nDQEvqGVYHlIuul0UwY+wUU3w2ctpRPwUJYw9T3nrwNjnLJ1TSqJk 6MJkJD29BJsEvHDQzY5n3w8W/26B9RQA7DSAiaoSKBiavyvjk1Ag8C6tEN1d79iZS1G+ EKizetW8DadMrWfHKO+CQkfOb8dIX2KbwC//zbEf6ZsUQrMs8SPNjOfSE21SrW7is1ow mszOVXXyUnodfvwYZUTT3gwGAPLJpUVJfO8E4oUp4t+48ML3/R4CkmEZJKTts2briCwk TajZjUSp0C82txAECdi0MMTpjlsKZhK5vdoBc5DE0TXtCmKsNPNsll90TeeZPflTCDdN QA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kfaheegu6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2022 20:57:30 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29SKicVl009398; Fri, 28 Oct 2022 20:57:29 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kfagge7yw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2022 20:57:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V01yAdp6HRGeqxKMxHcNvSQ5gMqMPDY/g8u69BdpIPAGcLQyCFEC+pDU6D5S+yA8MhtvKAxobtGOjCuyjbA/W6Yir3nzPuriu/CwMuGJ/G2d3NLJIBjQ7aNEWkEnuMoOqyHgjfDuyy+XiO+D9QZPuG37y90X295MLSkgA1z8Q+vfKhkNVHGQOo9cMjZ21m7fEA5ZJ4l/KjAt/7s4ltil6cfctFHVNq/orKpcEi6CUZRFAxZxnA4ANRwYJVmsVxoBSekqzyrIPWYtaWAbkYd3s4WqzmveuTTcdvoltY5PnPbIzOqjFOnLBZ2d2iQwztwkbvVe4lSJQLQFBEXAkSmKig== 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=G+P6y0xg5d0XwQE3uD/+U8YtPy1u4zvrcgtQISkIur8=; b=ZZVd7JWJnOoxrOsfPOr52jJZ/sZBjsuvaoe9t76ZiJhGiQ4YlmlDpsEPDlm7SfjfIxP8ES/zorY9ZmZXGH7Ii+RhzgNbk4gTQC8oLrJdzY3qJJA+b/crkgHodbstvOFCp9XSda32C4PJgpqT0tatoDBYwaTFiYEwka1CmEgMESPrKA+XZKnrY7/rA5BYqsdWSV1cPTekr0qAWje3dAcri5ze/7T4Lxx/h4RYLX1dR7Df5gA2Ddr+uwq0An+TtI+MjPYp+E43s5sbut1Ek/gFSABMQhf3NqLF/4pz5qOPe3DHXsvWLgXP3l5nemZR7KufULDU3wLjKJc3QtF/xuenNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G+P6y0xg5d0XwQE3uD/+U8YtPy1u4zvrcgtQISkIur8=; b=O+FRV1HJNc6/xqhP+yRFm3j5DPUNJVhneabNHi28waczZpTyfdQq3kdNSOMBKrelw5fUVR2Vnx/tQgMK26Zs1u0GE9zP9sbqooFxCTEUmX8HuOwuD0AdEM87NnSYMnBv0TSK+fXtdON9Q4/5MSHNcNvpwfZ1mWrpFfkY7Zuicv0= Received: from BN0PR10MB5128.namprd10.prod.outlook.com (2603:10b6:408:117::24) by PH7PR10MB6507.namprd10.prod.outlook.com (2603:10b6:510:202::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Fri, 28 Oct 2022 20:57:27 +0000 Received: from BN0PR10MB5128.namprd10.prod.outlook.com ([fe80::5403:3164:f6c3:d48a]) by BN0PR10MB5128.namprd10.prod.outlook.com ([fe80::5403:3164:f6c3:d48a%3]) with mapi id 15.20.5746.021; Fri, 28 Oct 2022 20:57:27 +0000 From: Chuck Lever III To: Jeff Layton CC: Linux NFS Mailing List , Neil Brown Subject: Re: [PATCH v3 4/4] nfsd: start non-blocking writeback after adding nfsd_file to the LRU Thread-Topic: [PATCH v3 4/4] nfsd: start non-blocking writeback after adding nfsd_file to the LRU Thread-Index: AQHY6v8cX8B2IAnCiUGFnEk+Gt8JNK4kNxkAgAALLICAAAeCgA== Date: Fri, 28 Oct 2022 20:57:27 +0000 Message-ID: <90233EDB-0366-4F66-9278-1FFF1AEF1C9B@oracle.com> References: <20221028185712.79863-1-jlayton@kernel.org> <20221028185712.79863-5-jlayton@kernel.org> <89288CA4-F679-482C-B9D1-68C583D7F5BA@oracle.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3696.120.41.1.1) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN0PR10MB5128:EE_|PH7PR10MB6507:EE_ x-ms-office365-filtering-correlation-id: 849cdd95-242c-4351-6b39-08dab92705bb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: shpBEuirRu4WuYemEaCBt9707grY30eIFpV3tzpx4gi3eijaWl1dFV0W9qUm92Cj6Pj3GuU6Js3Ywp9cLLDxCWbQjwlu56ruFBalL9PZB1mhRZEoozQjw6f9Swu+gLBtt5mnBodt2d4or0uTL5EGzOyOucD7JbeCrnMpsvuhFEziHHRs16Y2o0V+0FQvHoNQOnKxOVP7Y5uZpauytvTA4PmxgDSjtshOonmONlNbTBiA9wXe2T8H5F5jSa9SYNZ0eBTMXKtpu9/QL6Ns3o4HVBQinign4whLROUQ+r6jnbfGdFnbSSjV8KToRMmutZQUS9lcQirfdoYmig8NwMoeHWUkNwr2Pn+b1Bvpsxa2YDS/D9ykBhtIDRED5qa0xgmGAE1X93y7oTv4q1TsJ7XTkZ/6dvevmLr7CK9LMqVXYLNt/XO6IajX8W141vB58SzHMOJPa+3slh1zbMf7GN6umZpiepVxCQ8ffN5KQcU4fVofFIdxno9+fC+15dL5PWUccdh8IXvkmzSpBQq28ckvBQSQ5iO7j3IM4CVJFEZlrUDITQ45+Oba2XZaqPCQRL+xwWA03Y34ydm5hv6C0zaV7mqw89E+kPH0DHl2C2eq17BNzUXNq5iYpYqcF6ClF44CL0V9urlq20TTJWsgeES2x14EFQo6FgyvodYRxvB5V3V3F7WIlRaQhVUFVAAAL41PSpNMp7n7TGHHCyRsYkLcdb4nTQ97Dex21j/8dmqKACT6zzFhcw8R394Q5Hz/pr+Xg3HH+4xlQc2pbS3IPdb4wZx62EXiwqESaxSZXNA66Gk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN0PR10MB5128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39860400002)(136003)(376002)(396003)(346002)(451199015)(478600001)(71200400001)(186003)(33656002)(8676002)(83380400001)(8936002)(4001150100001)(41300700001)(2616005)(2906002)(66476007)(4326008)(64756008)(53546011)(66446008)(76116006)(66946007)(6506007)(91956017)(66556008)(6916009)(316002)(54906003)(36756003)(26005)(6512007)(86362001)(6486002)(5660300002)(38070700005)(38100700002)(122000001)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yiLjHsPdLhlHJzRPRLUuhm6gNgoP6YfWEy0KwlXFJMmeERAqfLovSnAdwYZn?= =?us-ascii?Q?8vfb5CVXLzqcHMZBo2nipa3Amunsn9mMLdF1MLZRnZYCsGLdS1UyX8PF+zEY?= =?us-ascii?Q?byAoZgWyI9PoE67R8n64UHw78S2luAZ/5OT5CMhpXnNCHNW8xuWZDXTWHBep?= =?us-ascii?Q?rcG831LP1iqW1M4EYnEKq4dp6ashQ+ikChds0cMPy2cdFwtmXJx58eNDNk8A?= =?us-ascii?Q?VqBB2zf3SBS7/5Mkg9JPemyN6Hf8QfvFWyxNlhN/ANweCLNdj9Duj+OQZk+i?= =?us-ascii?Q?AOlQNnPBJQj1vqTtLNq5UEqgi69WXBZkNyTLAAArLdhRNOcGdpSRzOLULGTo?= =?us-ascii?Q?dW4h+fWJ3i14TpGXqApU5s3HJJbHel0DVfSMcv+wHCiw2/wAhuwukMFxb5xf?= =?us-ascii?Q?A4Vfq/1nwdABjGTEsYe0pwf5jI1qmSIpWqzYYdP3kAhPOP1jug7Xg1uG6Q7n?= =?us-ascii?Q?mTREVO6hHFNhKaQ2N/btdY1sfYMafB79yMtlVYbcgyzrhPr3TiM57bAIw3x0?= =?us-ascii?Q?ZtR2Bbuqa9d93g11/rplqPR3gYSrBIdwUNz1Ovx1CZxPVD6IO60TQj6ZJlV9?= =?us-ascii?Q?YVJPUnmZfaNqyZy8O+vZ0hLoCkgE+b2HqyZza6WHATI0QCq0HD/6Awv1GpUJ?= =?us-ascii?Q?hg7Wcrm7a9sq4RCiQRuLMwt2xD0kk2WB0gLBIV98bGI8Kl+7M8zXrAO3zOhh?= =?us-ascii?Q?n9ZKRAb21hJ9a2UAPgHnC8YDgw5ttuMV2paU5y7tE4jNEpERMfZOh/JWFbS3?= =?us-ascii?Q?W+q2j4AOZ6XnAJxomjcxaDuB3zP407xD7YHhtV/BtZmp2lCj9p07vdtHkJiJ?= =?us-ascii?Q?QzOfPMiqAdPBrxtm1u9pEy/9FbqWb5wXHglqxUtv8beEn8lfTg31tb/8RL0M?= =?us-ascii?Q?P1Tg4Khz/RbxjzZ3XVyXnfWQ2JKXwmWxGIBq492xfxd0srcOnDuqI7gDNbAG?= =?us-ascii?Q?GnHln9ZaMxtv/sW7mOzFtl9dYv6Ja8t0H8FbdWUkZQ9zVaRHmE8xg8B2Mu16?= =?us-ascii?Q?4SSvaoZx1RMO/8w74rBkcynoT1q5oMpRbvT/xzNbLmE/NOzdXwyochyeFs+t?= =?us-ascii?Q?/qDf6lvtUlCIWJB4T4QVnAAQZJUrh4kmtPNwk9eIDqxPkRwAsCQTZT3YXPXH?= =?us-ascii?Q?CX3NyTRH28qs7lh18AtL4+nfLd4J1yFGMO6wcsQuP/eMSNzrlP6+zSnSQ2FC?= =?us-ascii?Q?MJx7pnsg/sReyvDMcldTXdiqgihy7CczQ2RW7YzwQVj/GiFlty4CXX3iWj2z?= =?us-ascii?Q?eKA6vjot9WHaZC7KgtlKrYMpommIdwPB5gc0KXQwiy5z8DB+USwbEb3u6Kfl?= =?us-ascii?Q?WiZMeo2rDVYDtvwWf9G4fU0glfl9A9HNGaVkpk3V7aJaZB080Hx9F7JSyN5D?= =?us-ascii?Q?Vxr95HHqPBK6ZMWAWVZjDVfn/5kmeDEf0BPFGNwkhvoGKJc6QruB9tErQ50k?= =?us-ascii?Q?Td4Na3CTqVeW3ReZyYtRQMUw1bIuiyJzs/1NqgqjVTgM3b3DIPH+ggU44QHI?= =?us-ascii?Q?uxAREH0OPbkVMwhAt9K51xezZlZG+CrXSTlZ8zX5Tt8xd8F/O+R8houBP3Zq?= =?us-ascii?Q?oOc5XkyrYddMCtNIk64yje0XZGA8AVzp5SjCiuYAMy1bnZw/LUnrUADSJRrD?= =?us-ascii?Q?Bw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: <870FFED3756E5A40BB82C468FD0E9794@namprd10.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR10MB5128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 849cdd95-242c-4351-6b39-08dab92705bb X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2022 20:57:27.7222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tUy13B8PSBqnczCk1y6++W7jN4YppW6LTqeZw3kXRVBMDDffkkAZLWOmZ2QT18P9clfCp9X+f6OcSZpnw1OFFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6507 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-28_10,2022-10-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2210280132 X-Proofpoint-GUID: XMaUvCh8wVoMs34TEJ3Tlz8NYndPebT_ X-Proofpoint-ORIG-GUID: XMaUvCh8wVoMs34TEJ3Tlz8NYndPebT_ X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org > On Oct 28, 2022, at 4:30 PM, Jeff Layton wrote: >=20 > On Fri, 2022-10-28 at 19:50 +0000, Chuck Lever III wrote: >>=20 >>> On Oct 28, 2022, at 2:57 PM, Jeff Layton wrote: >>>=20 >>> When a GC entry gets added to the LRU, kick off SYNC_NONE writeback >>> so that we can be ready to close it when the time comes. This should >>> help minimize delays when freeing objects reaped from the LRU. >>>=20 >>> Signed-off-by: Jeff Layton >>> --- >>> fs/nfsd/filecache.c | 23 +++++++++++++++++++++-- >>> 1 file changed, 21 insertions(+), 2 deletions(-) >>>=20 >>> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c >>> index 47cdc6129a7b..c43b6cff03e2 100644 >>> --- a/fs/nfsd/filecache.c >>> +++ b/fs/nfsd/filecache.c >>> @@ -325,6 +325,20 @@ nfsd_file_fsync(struct nfsd_file *nf) >>> nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); >>> } >>>=20 >>> +static void >>> +nfsd_file_flush(struct nfsd_file *nf) >>> +{ >>> + struct file *file =3D nf->nf_file; >>> + struct address_space *mapping; >>> + >>> + if (!file || !(file->f_mode & FMODE_WRITE)) >>> + return; >>> + >>> + mapping =3D file->f_mapping; >>> + if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) >>> + filemap_flush(mapping); >>> +} >>> + >>> static int >>> nfsd_file_check_write_error(struct nfsd_file *nf) >>> { >>> @@ -484,9 +498,14 @@ nfsd_file_put(struct nfsd_file *nf) >>>=20 >>> /* Try to add it to the LRU. If that fails, decrement. */ >>> if (nfsd_file_lru_add(nf)) { >>> - /* If it's still hashed, we're done */ >>> - if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) >>> + /* >>> + * If it's still hashed, we can just return now, >>> + * after kicking off SYNC_NONE writeback. >>> + */ >>> + if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) { >>> + nfsd_file_flush(nf); >>> return; >>> + } >>=20 >> nfsd_write() calls nfsd_file_put() after every nfsd_vfs_write(). In some >> cases, this new logic adds an async flush after every UNSTABLE NFSv3 WRI= TE. >>=20 >> I'll need to see performance measurements demonstrating no negative >> impact on throughput or latency of NFSv3 WRITEs with large payloads. >>=20 >>=20 >=20 > In your earlier mail, you mentioned that you wanted the writeback work > to be done in the context of nfsd threads. nfsd_file_put is how nfsd > threads put their references so this seems like the right place to do > it. >=20 > If you're concerned about calling filemap_flush too often because we > have an entry that's cycling onto and off of the LRU, then another > (maybe better) idea might be to kick off writeback when we clear the > REFERENCED flag. I think we are doing just about that today by flushing in nfsd_file_put right when the REFERENCED bit is set. :-) But yes: that is essentially it. nfsd is a good place to do the flush, but we don't want to flush too often, because that will be noticeable. > That would need to be done in the gc thread context, however. Apparently it is already doing this via filp_close(), though it's not clear how often that call needs to wait for I/O. You could schedule a worker to complete the tear down if the open file has dirty pages. To catch errors that might occur when the client is delaying its COMMITs for a long while, maybe don't evict nfsd_files that have dirty pages...? >>> /* >>> * We're racing with unhashing, so try to remove it from >>> --=20 >>> 2.37.3 >>>=20 >>=20 >> -- >> Chuck Lever >>=20 >>=20 >>=20 >=20 > --=20 > Jeff Layton -- Chuck Lever