Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3788047ybi; Mon, 29 Jul 2019 12:37:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxn45k2VZUwy1dujVPBxdj7duVYy4EURYHmcCrgb0fqdN+VEn0T3k1ZUaNB5YaXwFO9/Zt X-Received: by 2002:a17:902:f46:: with SMTP id 64mr112567233ply.235.1564429071022; Mon, 29 Jul 2019 12:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429071; cv=none; d=google.com; s=arc-20160816; b=tpsYnbb8t5Q2QrwBPDI8nryhT9xOTxEQOhj3xqUkFy+FeuACDpb6b3RDIel4H/lUrF BL+bMZH1ygnW8/VwmMpzABb4Q1xQCOKiRtNMG+pwxZMsBcIIE+Pg/7m1lwtJml2ayMc7 dYj5X2z2hdpZwpze+fQdcyWYz+XwCfNKqPB2w+V205hpaGzrwFuKqQfLeaDe3HgyqHTc nJaXr1L+50jI7ZR4HR60D5InswM4f9+LJusa/VB5fU/sZBzuLoxwoIU3XNLhJ8AmsYEw ZCpo3MoFZqBvBp2sgozGj53lm12vUX4HHuskYEbLNIQ2MLfcHI+G9ICPrwijCvNlPN9X ljyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O1gdbAo6E3DxxHSg9rs+iiqtd31lCnSs7KIQ12bCack=; b=NHpSrht/b+t5j9sNbMSiWggAgp12376beg/ktf3Vb9MBTbI6KFRx/WflgklKSt480s yR+T6iIA9E6nvNx1z9IvWH/lf2rU/miA9U5X0oQHhMMVTP9xy+2gOL5yCQlOm+xxLR/n BYZJW4k25PCh8spL7wHlVo96zh8C8+PwfvlHnx8tqh0uiV3IqTXsbfnC4KptIq7fVsuk diUy43k0R7godc02nBUIamtz3uPldDAYAUpmWaNUUDkOklijg/9NXgqcVgeuWvTbgwjl 3AZn+sunZRCIEyW7NOKu7iXktCGCGVegVlkqkb40yOZsY+2xlmVz+yeB0NPq8zju87jE iLMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yQaZ0Q5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si44187307pgp.288.2019.07.29.12.37.36; Mon, 29 Jul 2019 12:37:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yQaZ0Q5M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387555AbfG2Tey (ORCPT + 99 others); Mon, 29 Jul 2019 15:34:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:49216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388488AbfG2Teu (ORCPT ); Mon, 29 Jul 2019 15:34:50 -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 75ABE21773; Mon, 29 Jul 2019 19:34:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428889; bh=cuj6gjrv7yJRiT+f42miZQVAU+p3pGlzJe2vlggRx0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yQaZ0Q5Mcm9gERxUZHC2dSVlTVXDCBIi49TQCh6wY/8DypgXd7M5m9FvMGTERR7Zn UuYHehmS7NTEBORCY24awTdo267B6NDnq+AIf+ZOV9EXGshJfgLCZBTz7GNgLP8CAt swu4Sh5bB8JXEOZnjb8CuBOvk4vi2RqGwk6KUnNU= 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.14 217/293] nfsd: increase DRC cache limit Date: Mon, 29 Jul 2019 21:21:48 +0200 Message-Id: <20190729190841.137329436@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 e02bd2783124..4a9e0fb634b6 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -447,7 +447,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