Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp310421rwe; Wed, 31 Aug 2022 03:18:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR7OQAIWGD9tmb6tMepJytFD69JaSJRq20EERb33iB+E0l7w6zJ9iN+eTn4ZLGa1aQDJY919 X-Received: by 2002:a05:6402:248f:b0:440:9bb3:5936 with SMTP id q15-20020a056402248f00b004409bb35936mr24572694eda.178.1661941103043; Wed, 31 Aug 2022 03:18:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661941103; cv=none; d=google.com; s=arc-20160816; b=Qluq+97U1v8H/p8l3hy+D4qVrxcQv+O6ZONOMW7lE8P9tLPsNLEuKuCPr1CsWamiaM w9zjjjLFoqSROniX1vTQM139xqwlirAKy84gGpBahRSC/3A2EfdCdf/CDIlrd6nSBIlZ +NzlLzP77FVOXiGIkigYWACMk7/mQwwUDCTuTp1dngFFBsil49fJ/LCX6ZAUlhHRaBBM FKPtBfH6fBw6kyARy/S/U8NHKfLjCSRPniHyG7rn9Sffr7oWYjYSvqf6eR/hFEOR07VM 4dlsO2sStWc//6e4X08VLfd3R3GvXzKx92puSU0Rb9obKbDXTBaO08Sq4qPtuIjBTGl3 DRtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=psV+8u9e3zdgYOdHtRxArCOECbuBgpf759aldHgifPk=; b=UpvOD3dqFCRSWWLLR0NvcM7ISI1xyxkLSUmTpYfBsqvlAZJ1IhhxWbxl0QWrKm3DL9 p6bgmhsp/sGloGu0iM4pSpKBXCYIoGxbd4esjhFerxTKer/EDxieKsQ/MPy50B3AmPua sG/wQShIMwZH+17olOkSatXABHKQRaDSeYrMA/1EpSm32LXYCEiLFleVfVEYdFP3/2bx fN0cZelqDLXBK2z14e/xF8ZfKfD3jBvWFuXDguqvrT9I0ABiCg0RCj8doThOsbFdWenX pLE1ntHYY61Bw6lXhXbK+PMUMGyBrJtkTjHERq9bFH/6iA1Iazh5hOZYUmyOjCOhsxn6 ZW8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dEGfEHX4; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xg8-20020a170907320800b0073d5ed5bdfdsi1967469ejb.377.2022.08.31.03.17.49; Wed, 31 Aug 2022 03:18:23 -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=@kernel.org header.s=k20201202 header.b=dEGfEHX4; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiHaKA7 (ORCPT + 99 others); Wed, 31 Aug 2022 06:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbiHaKAf (ORCPT ); Wed, 31 Aug 2022 06:00:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AD4A6B140 for ; Wed, 31 Aug 2022 03:00:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C37C660022 for ; Wed, 31 Aug 2022 10:00:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7155C433D6; Wed, 31 Aug 2022 10:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661940026; bh=E8Mlr+2QmDfQQTay2mfw0YNxAMkEwtsGCXxUdyRwtDo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=dEGfEHX4v1JJXf+vbdmW2eXzJblWHQJTx3DXZ19cUwwNKFiikILbcSE7tyroVvVih mFVgpoQs0wVw6Ty/ripciT7beYrdRLQK6QLey49LkT9JfRTRoxnVeMx7dLpnW9leU1 a7T8QvSXkKgXTw6TYp2BhqNLW17ggAX5hrTat7T4UMb7vpFykfyNfQmOjjlmQcT32G VWYH8vMte/rEs8Jz7tjeEvUcPFlmZr1u5q1K5MLaoPJ8+Z/6oI6TInCjEVZx3Ftl04 3sqw819nLOI2+ZQTrkYsioIJGT5YnXcPiJsC03Bg5GGI14y/1uMcob+4rTkVKK+cfb OteS3HUBSaS5g== Message-ID: Subject: Re: [PATCH v4 0/2] NFSD: memory shrinker for NFSv4 clients From: Jeff Layton To: Dai Ngo , chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org Date: Wed, 31 Aug 2022 06:00:24 -0400 In-Reply-To: <1661896113-8013-1-git-send-email-dai.ngo@oracle.com> References: <1661896113-8013-1-git-send-email-dai.ngo@oracle.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, 2022-08-30 at 14:48 -0700, Dai Ngo wrote: > This patch series implements the memory shrinker for NFSv4 clients > to react to system low memory condition. >=20 > The memory shrinker's count callback is used to trigger the laundromat. > The actual work of destroying the expired clients is done by the > laundromat itself. We can not destroying the expired clients on the > memory shrinler's scan callback context to avoid possible deadlock. >=20 > By destroying the expired clients, all states associated with these > clients are also released. >=20 > v2: > . fix kernel test robot errors in nfsd.h when CONFIG_NFSD_V4 not defined. >=20 > v3: > . add mod_delayed_work in nfsd_courtesy_client_scan to kick start > the laundromat. >=20 > v4: > . replace the use of xchg() with vanilla '=3D' in patch 1. >=20 > --- >=20 > Dai Ngo (2): > NFSD: keep track of the number of courtesy clients in the system > NFSD: add shrinker to reap courtesy clients on low memory condition >=20 > fs/nfsd/netns.h | 5 ++++ > fs/nfsd/nfs4state.c | 65 ++++++++++++++++++++++++++++++++++++++++++++---= - > fs/nfsd/nfsctl.c | 6 +++-- > fs/nfsd/nfsd.h | 9 +++++-- > 4 files changed, 76 insertions(+), 9 deletions(-) Reviewed-by: Jeff Layton