From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A090C32750 for ; Fri, 2 Aug 2019 09:33:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 634EC21773 for ; Fri, 2 Aug 2019 09:33:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738436; bh=xiYu9wTxlylBJbnw1wZllJ2RAgrqKYutwJW4hPjzZOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xymXo6hljF+ZgPCXNr1k8PHjrmRQafFPDETBZi1DhIh/ZHZox5y4+ccc7ZyFibM7e CEX0hUZg2iklxtJWmgLfrSiSRzLH1QmE0BKI4zp7IA3VFXFnzm6ypVivM2BjfVbAte fAL9+QkrVmj4yNDNedaM8CaIPPy7PL/6eRv4sLXc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391454AbfHBJdy (ORCPT ); Fri, 2 Aug 2019 05:33:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:33502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391450AbfHBJdy (ORCPT ); Fri, 2 Aug 2019 05:33:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF17C217D6; Fri, 2 Aug 2019 09:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738433; bh=xiYu9wTxlylBJbnw1wZllJ2RAgrqKYutwJW4hPjzZOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IHs2cLKaDBZSYZ6Lou0xcHZfw6UUPhwAHFohVhjJ3dP+fGSevN97YwztGKfIvQ5NE t4uW/F2/iw1l2dVA6fncq5PwbrF/UrlPljwtZZQzWMbwmtRnM/+eI5yk6YRjqqh4BT qKRTdOP2hh4Xz7IDpaVUo2RU+EmYEBx5zXAcIVLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "J. Bruce Fields" , Sasha Levin Subject: [PATCH 4.4 102/158] nfsd: increase DRC cache limit Date: Fri, 2 Aug 2019 11:28:43 +0200 Message-Id: <20190802092225.293756554@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 44d8660d3bb0a1c8363ebcb906af2343ea8e15f6 ] An NFSv4.1+ client negotiates the size of its duplicate reply cache size in the initial CREATE_SESSION request. The server preallocates the memory for the duplicate reply cache to ensure that we'll never fail to record the response to a nonidempotent operation. To prevent a few CREATE_SESSIONs from consuming all of memory we set an upper limit based on nr_free_buffer_pages(). 1/2^10 has been too limiting in practice; 1/2^7 is still less than one percent. Signed-off-by: J. Bruce Fields Signed-off-by: Sasha Levin --- fs/nfsd/nfssvc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index b6eb56d18568..0fa990f08daf 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -360,7 +360,7 @@ void nfsd_reset_versions(void) */ static void set_max_drc(void) { - #define NFSD_DRC_SIZE_SHIFT 10 + #define NFSD_DRC_SIZE_SHIFT 7 nfsd_drc_max_mem = (nr_free_buffer_pages() >> NFSD_DRC_SIZE_SHIFT) * PAGE_SIZE; nfsd_drc_mem_used = 0; -- 2.20.1