Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2094687pxm; Thu, 24 Feb 2022 16:20:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwtAF51Ptv1HCuKojhZfgFjISLN/qA4tb3J2wN6A1Xmcufmn+UGde716Mvvym1JEdjhdwg X-Received: by 2002:a05:6402:3508:b0:403:ba8f:4265 with SMTP id b8-20020a056402350800b00403ba8f4265mr4666981edd.184.1645748436333; Thu, 24 Feb 2022 16:20:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645748436; cv=none; d=google.com; s=arc-20160816; b=OCash5SaWO1vO+2M5QZzooCB0RPeTAwAAS9d2zXU66CmKuqgZ8LSdPUBHT5/o75umt EEmQBAlTLAAVupEmv36dlDcFXdPcyImZLEGKITCPTh1eClwaSJ0ZY6qTfexbiECCh8/C gzhvilmEDmjWMd8RJ9jQpKu3WV1HzMryp4a+Ui660YUMoSrfOHy4lLruuBSoNzYkaC6R vMTa6K0VeNwYalvFf6C1SKwakM5PX02aqW87+RsQjePTg+zLfQBO7Xgfx3rQNHR5MBOF 7GUxDEhXD0CyTPVvvhe/1PDQWev4+bCMpXNnOIS0zZT7u22BepvqNI+Rf8GmZWrvJQy7 7sVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=cvuJ3OoAyDi8/vXmpOMGFd3EvwNT+UpaWjL8u7LVl5A=; b=MGHEz5mx6dPOtlvVVndZUfTrz1MCyyhOzwjaLWK4C0WXxJFBcWChawJVaI6fHXMDeg Cbhd09o3YkFLG4uvsHAfoJmzFlIfpM2L5/Cn6rH5tyc6ss4CfYXzeYfvzQChzyo2Z7mb IWN5R73k9Slyaf6zurOVKMUDeZHqO94hGScII6Obym8CZ08wNXwdfFQspatERLWaVGIP s694w9544tKX841CQkn9ishtDYbaknoq+w0Z8OYlg/iCE7sm7wCdySkAYeb/ehTBTX0u NHIjY1so0+si0uarT3BwFOzyaib4QRkND38cPW30w7zNst2q8mgY6UN+OUi5st+8jx0h Yo5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wCMnqg1T; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc11-20020a1709071c0b00b006d0adc9c26esi721496ejc.892.2022.02.24.16.19.57; Thu, 24 Feb 2022 16:20:36 -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=@suse.de header.s=susede2_rsa header.b=wCMnqg1T; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbiBXVuR (ORCPT + 99 others); Thu, 24 Feb 2022 16:50:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231430AbiBXVuR (ORCPT ); Thu, 24 Feb 2022 16:50:17 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADE3122A2A3 for ; Thu, 24 Feb 2022 13:49:44 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 30F62212C0; Thu, 24 Feb 2022 21:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1645739383; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvuJ3OoAyDi8/vXmpOMGFd3EvwNT+UpaWjL8u7LVl5A=; b=wCMnqg1TcbXPYfrzJXpXhjb1Nomo9yhYDPa3li7tFcKItK4aPSVYFGja9U4X/liFfCq7Ax XsCwLpKyDnehCBQiyxorX8RSDXab4Y02yg6hHn7ikw/R94AU87jhuwVApMZJ/VpWxxkd1u TxuXcOFaeMWm6KIKyiBuh4HB2JDZyMc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1645739383; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cvuJ3OoAyDi8/vXmpOMGFd3EvwNT+UpaWjL8u7LVl5A=; b=uSpCfAUqpjuWOeuJdWXz7qvV/Kd9uuL2G4B94G9mM3mmA9QBO06SK5C5XPWA8BuAzE4kvR eIcmV7AXRTzut4AA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D045713B2D; Thu, 24 Feb 2022 21:49:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hkjqInX9F2IUbgAAMHmgww (envelope-from ); Thu, 24 Feb 2022 21:49:41 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Amir Goldstein" Cc: "Chuck Lever" , "Jeff Layton" , linux-nfs@vger.kernel.org Subject: Re: [PATCH v2] nfsd: more robust allocation failure handling in nfsd_file_cache_init In-reply-to: <20220224161705.1041788-1-amir73il@gmail.com> References: <20220224161705.1041788-1-amir73il@gmail.com> Date: Fri, 25 Feb 2022 08:49:36 +1100 Message-id: <164573937670.25116.10310536737134724947@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Fri, 25 Feb 2022, Amir Goldstein wrote: > The nfsd file cache table can be pretty large and its allocation > may require as many as 80 contigious pages. >=20 > Employ the same fix that was employed for similar issue that was > reported for the reply cache hash table allocation several years ago > by commit 8f97514b423a ("nfsd: more robust allocation failure handling > in nfsd_reply_cache_init"). >=20 > Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd") > Link: https://lore.kernel.org/linux-nfs/e3cdaeec85a6cfec980e87fc294327c0381= c1778.camel@kernel.org/ > Suggested-by: Jeff Layton > Signed-off-by: Amir Goldstein > --- >=20 > Since v1: > - Use kvcalloc() > - Use kvfree() I think this is a good improvement, but it would be really nice to replace this bespoke hash table with an rhashtable. They we wouldn't need to worry about these trivial details. NeilBrown