Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1179351ybi; Fri, 2 Aug 2019 10:37:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrTW+b6mBTzqlScBaVYEueMVpUi8/mecoOuWOdnQiP0cQwdbgn48nGC/3zDsyNMV1nFccp X-Received: by 2002:a17:902:740a:: with SMTP id g10mr133422813pll.82.1564767439073; Fri, 02 Aug 2019 10:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564767439; cv=none; d=google.com; s=arc-20160816; b=S69NaTjd4A4Dufo2cHw/eC2+sR91WJtN3hwbA5k7amvM80PhLEQpyTgbwLFpkBQ/Yv 4jAhdYLklECBHgGbVdYA/CkY0vSHxHxVvwVBj942vTYDxTSUT74fRAO+l7i3VqYsLMeF SJqhL+HDTHKc8mBTFWcHToPSg1QdshBCAL0L5PKXW2mpl6HjU5aTiyH4TDa6okqDTFrL 4sn82ck/uhTAzQxe5ZWuOIWadu3sLbpQOAKbFzCgleHuDizBsnaFdbD5/OHdge9KVtgi yDyJNBtSYH96hTVul2SgB3arvQC6SWMhNUNjFPmEkIH2gC5GDzAa4fzdIDWejBsBtIwi pJ6Q== 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=JvTTPWy2u2LfKGyD6chlA2vxT33mNr2awnAfBgCQLw8=; b=MsJRrgz+ko5qU5Z+4NNOY6QvPbjcA0V1U1lmuLJ+8aL+1DEGOEEmhashQOlHtGVhmF 85nDjw68cIiM/DgyW/lHs3t+AGFhtc/T3qmWkkkMVR5bT5t/yh6/8JL3oRpmWmAnhrxx MrRFRR7eNp9SSO6s4Vs+1RVEiEnhZehFeIfItbdqo+oXZ3dVhVi/r4BHBOBOShM1Y1p0 1+8iQeeA/vpMJIFMDtFGq89iauMC3iT+mRLJpRL+nlp0KbGjHRCJGVa9x2q8mQ7pxs0g zgZ9cPekhh5sWCZBWzYUwQYbUrOGE1jtyHLcinX9Hz4m1KPKGh+1JwaDzpBHq35YnFqJ iElA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u3OvZ7Vo; 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 c8si7176204pje.30.2019.08.02.10.37.04; Fri, 02 Aug 2019 10:37:19 -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=u3OvZ7Vo; 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 S2405757AbfHBJrz (ORCPT + 99 others); Fri, 2 Aug 2019 05:47:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:52894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405745AbfHBJrw (ORCPT ); Fri, 2 Aug 2019 05:47:52 -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 769212086A; Fri, 2 Aug 2019 09:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739272; bh=dULMVbLsM2Us/w7nK3XKknKq53cj9uoxHhCAqrBHDwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3OvZ7VoOiBy3Nt9miJlFM8WG+1BpH4ytMpIeiYaV4rElaFf70TZkfG+IFNoW+6/5 /HG7uZ/wrJaZoJo08wO7kTBTKRD5q+srREb4zaCqC/TxUCdaBh8Z/Kj0zOIUpr1BP0 7h7rfma1UWCeuTLMPvwwmGU4fkQ9njvkIsYBsLIA= 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.9 155/223] nfsd: increase DRC cache limit Date: Fri, 2 Aug 2019 11:36:20 +0200 Message-Id: <20190802092248.400563878@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@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 5c4800626f13..60291d10f8e4 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -430,7 +430,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