Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1512068rwb; Wed, 16 Nov 2022 19:50:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gvyuHMd/R+ece2LDo3ZWpDKgMDZdCvBAeioNq7Jsye8Q28M+LX5s6qP4FBBjnIXFNU16s X-Received: by 2002:a17:90a:d106:b0:213:1944:dde2 with SMTP id l6-20020a17090ad10600b002131944dde2mr815582pju.193.1668657030038; Wed, 16 Nov 2022 19:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668657030; cv=none; d=google.com; s=arc-20160816; b=sKzulaRS4Hi2xBllvPukQMGuF+oRijRYf7FoBPb51E85eu8a4ylx5CTSrWdZPeS0OI NUk/uMPioJz5FeHcVA94j+tfdPLVYSvOOZq+BMpYXg2ES1yatXX+dSSOpZyr94l1t7e6 o2a0BA7LPhndY/CpyS7alB9ohHRcdt/67Daf+EKQULuEvfBsIs9aPvHJ0cmTbxqj+7ZB 6mw8K1z57XKylFb0U1QiZ7OIVvEI0eo4sNQHw55HUVSyPkHMyqOJLwRrRTy1l7zvIzUR 6bRfOp8ky+0YLuKnrtmXbsyA2tiMq60R1UDkd8SWzVVYI8ZNqqE60HQ4Im3d0pNxsaSq 6gUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=wwc6DC6bbSlePCeywKNVeQCc6vfZLvrsUQos8eW5JGM=; b=RlUevNCfnr3XkJYEZS5uofayGglD3rjpEt4CVKPanYUmkvPSEqiXJl95vpe2vsTz++ YnMeptfzIFT1QauJ9u+pt4ud6HcC7XzzfeHtlK7/2JprSsIGkfHQdp7GbOnvEH/SDEv3 v+EkVDe48DOXcjtXL3mW7gIsugHPOIW6bPNvlDBLFO3o5F7Qly+OND2ndS+84qbe5zo3 jcdZUDXb6TsYBzfoIlFkvqxb894EzzEm0PtSp2RyzBL5SBf4e3WLsOH65ui9UyFkEzcd AX+T/EpIfRKEeG74RqyzfWvL8a9W6vHoHu2MjYB/QRmnZz6nvvtDvgMtv9017MmnOUWD 3SDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=qVDINHgJ; 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 q3-20020a6557c3000000b0046f58089605si16963859pgr.272.2022.11.16.19.50.05; Wed, 16 Nov 2022 19:50:30 -0800 (PST) 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=qVDINHgJ; 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 S238962AbiKQDpL (ORCPT + 99 others); Wed, 16 Nov 2022 22:45:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234246AbiKQDpK (ORCPT ); Wed, 16 Nov 2022 22:45:10 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9526A684 for ; Wed, 16 Nov 2022 19:45:01 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AH25nUc003956; Thu, 17 Nov 2022 03:44:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2022-7-12; bh=wwc6DC6bbSlePCeywKNVeQCc6vfZLvrsUQos8eW5JGM=; b=qVDINHgJGS0PyshesU1kv0gH2/sNv1FZOUBdIr0Alc0zpPCu6waxB+f5XGNoxi26sjVi 4gpH5vht3NcRsxwIfpweao+QENI8YN6KaP9UMAp32aPjpZSQB6weZC6a1e71Zuy3O3Av ylwJ2amI+Jbr7bwvFlIIqGeXgjrY2eCgogs1kgfrFDjCQG8NvtTn72+R3d0dyf74J1z7 Mky/MfbLgUGE7WiRmFvNGWnNwjPYEMVXVneZeyjE4xyWJMCR4E5tn3/3EIZGCAryo4mf KhIBqU67w//gp5oVKHpklpYZjBN6tfIc27vqLBdw3P5MCqRZuHp5TqqZePXPQxbsLmSQ eg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kv3hdy5t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Nov 2022 03:44:57 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AH1I7Dj016882; Thu, 17 Nov 2022 03:44:57 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kuk1ya26j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Nov 2022 03:44:56 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AH3iutd030624; Thu, 17 Nov 2022 03:44:56 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3kuk1ya262-1; Thu, 17 Nov 2022 03:44:56 +0000 From: Dai Ngo To: chuck.lever@oracle.com, jlayton@kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v5 0/4] add support for CB_RECALL_ANY and the delegation reaper Date: Wed, 16 Nov 2022 19:44:44 -0800 Message-Id: <1668656688-22507-1-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-16_03,2022-11-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211170024 X-Proofpoint-ORIG-GUID: nfhssxX2lQHCtuVvubUWWiHJZdbxy0jT X-Proofpoint-GUID: nfhssxX2lQHCtuVvubUWWiHJZdbxy0jT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, 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 This patch series adds: . refactor courtesy_client_reaper to a generic low memory shrinker. . XDR encode and decode function for CB_RECALL_ANY op. . the delegation reaper that sends the advisory CB_RECALL_ANY to the clients to release unused delegations. There is only one nfsd4_callback added for each nfs4_cleint. Access to it must be serialized via the client flag NFSD4_CLIENT_CB_RECALL_ANY. . Add CB_RECALL_ANY tracepoints. v2: . modify deleg_reaper to check and send CB_RECALL_ANY to client only once per 5 secs. v3: . modify nfsd4_cb_recall_any_release to use nn->client_lock to protect cl_recall_any_busy and call put_client_renew_locked to decrement cl_rpc_users. v4: . move changes in nfs4state.c from patch (1/2) to patch(2/2). . use xdr_stream_encode_u32 and xdr_stream_encode_uint32_array to encode CB_RECALL_ANY arguments. . add struct nfsd4_cb_recall_any with embedded nfs4_callback and params for CB_RECALL_ANY op. . replace cl_recall_any_busy boolean with client flag NFSD4_CLIENT_CB_RECALL_ANY . add tracepoints for CB_RECALL_ANY v5: . refactor courtesy_client_reaper to a generic low memory shrinker . merge courtesy client shrinker and delegtion shrinker into one. . reposition nfsd_cb_recall_any and nfsd_cb_recall_any_done in nfsd/trace.h . use __get_sockaddr to display server IP address in tracepoints. . modify encode_cb_recallany4args to replace sizeof with ARRAY_SIZE. --- Dai Ngo (4): NFSD: refactoring courtesy_client_reaper to a generic low memory shrinker NFSD: add support for sending CB_RECALL_ANY NFSD: add delegation shrinker to react to low memory condition NFSD: add CB_RECALL_ANY tracepoints fs/nfsd/nfs4callback.c | 62 +++++++++++++++++++++++ fs/nfsd/nfs4state.c | 116 +++++++++++++++++++++++++++++++++++++++----- fs/nfsd/state.h | 9 ++++ fs/nfsd/trace.h | 49 +++++++++++++++++++ fs/nfsd/xdr4.h | 5 ++ fs/nfsd/xdr4cb.h | 6 +++ 6 files changed, 234 insertions(+), 13 deletions(-)