Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1699643ybf; Sun, 1 Mar 2020 16:06:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyGwwH748VYNxct6p1PD73bhKgYk8Mj8g8DAj/ydfM7O8bAKA+TDhxLOX3lhduxKPJDm6oK X-Received: by 2002:aca:ad55:: with SMTP id w82mr4122550oie.133.1583107590983; Sun, 01 Mar 2020 16:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583107590; cv=none; d=google.com; s=arc-20160816; b=vveoOjV1FB/v7dHBiE+s0F1wzbWewSTPjjjRkMgMZN93dF0ykiH0Xfn08lI2IchMDh VzjvxQx8EEKdJNpb2loSQNhQIa6z5/4M6+ZVFKlULBvY71XHtExMbULd5POp9u4RgEH/ lMTz4y+n/GOYqirGCeavJo5YzEaf57pex2p930icLSSZzDhpN3bAG1JeiWbnlnoWjXdM ZzXSEl6mBx2gFpFwr3681nSSCUY1pSO4K4fpQBoocNdApSE0De7py2AiDm6A4f10rzGu bz38Z3YlHhNtH7PmQD66NlnOHgI8MaPQ/aSODFNEBgnyh3plvA2ae0kZbAcVe043zXAH NT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=VL/26nrsiNq7DuIRWSkkYww+xvM85UOTiZtGPRjHpNk=; b=t/l4VoGDkI99JHzh7FTsHMJ7p9TYbYJMibR8qr5ufHEdfMpvlEPn2ZGZJJN38oWExC r/7Qf3aBUPirGB7G1klcrVuPgQ2XmHNpJT98ti9YDLUtMIrs6Voog6C+P7Gr8P8p8eAB DT4MNblipSGUGf8COqQ9j68ksCJBVaSicLOkVOyf5CF4ngr2+W02T+XGpZwxT9XWMjNY gVOCl+LPCBwWkSKUy4FhUeC9JvxdR6zJqCaSKA2Ifk3C30Q9YHPX4wQ+MGqLhfOEnRnA AY5POWnb/lBPAhAG1fiRtxDK9vu8/i+zR/Avu3y+/yVb+l3Pg4FXzSTa73FObfLIIiAO cpdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jCcOCzMo; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15si940565oic.269.2020.03.01.16.06.18; Sun, 01 Mar 2020 16:06:30 -0800 (PST) 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=@google.com header.s=20161025 header.b=jCcOCzMo; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726956AbgCBAFb (ORCPT + 99 others); Sun, 1 Mar 2020 19:05:31 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:55792 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbgCBAFa (ORCPT ); Sun, 1 Mar 2020 19:05:30 -0500 Received: by mail-pj1-f65.google.com with SMTP id a18so3633112pjs.5 for ; Sun, 01 Mar 2020 16:05:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=VL/26nrsiNq7DuIRWSkkYww+xvM85UOTiZtGPRjHpNk=; b=jCcOCzMoAkxXO+a3yWBfOiJ45Uf6bESOwIkL0nuReQm+hXnoJwd7QNZ95iQfEwf5FS WDMU+u651Q4nSYiMAm/0Ch3j097L+dqdbcR31evCgWTwULhVye/8jN3qTlzIHyhWPwJu 6xUPh3PHJkODxQRc8C/UfjU76yJ2NInhCAgHQe4py8NJBxKXJci9b5h5Xb/WzNciCZU9 dLlMhG28C6RkaL7YiovEpJnGm2sgg27WuFd+cJqOLibTFDx5dxfYqgEaBhOZoCeg2Fv8 iL8SVfJLrpEwEPdgkDiBTC1OpG5PRYqxpL1dOmG63t9l8NzL7KTifBuJixO7irce2jiW Tyxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=VL/26nrsiNq7DuIRWSkkYww+xvM85UOTiZtGPRjHpNk=; b=ISiTc7IliO8eWbQkj3hsHry/DYuM6cXvTzSaufz2pyttIcb9jnASG21WAlNESfesRx Vi0XEsIGLuBjA/3lop4yZWEWXVl7o/m9p5mB+KvWLCVHaEStcSUeWHPvEJU2vIE9uJU/ tzavRmpNqHdcAi7w6As9CRebWVHGChh0HBI4zW6RXKRt/uedd5YyrWYYh6xmZasT/5Rw VLbaWssZQY2e93LHjv6Liupw0SK+vZ4IVMyoLsK1OVNGpt2PAVYyXgVras9CEa8Z781u bEimXWBdgzRv5f1y8RKF0hJCDdEwdSzDsJkUpnZ0qLoREeEXp0fFj5jMwbapd4JTp/2d JALA== X-Gm-Message-State: APjAAAXW/k9CPNeNjrBWjXM9f5JnUB5NiwHj08+KOHFBtuHe8WETy0TS hrUu9PBbhN4aOaF5KfG1lXbJsQ== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3mr15245429plt.111.1583107528727; Sun, 01 Mar 2020 16:05:28 -0800 (PST) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id l25sm18140080pgn.47.2020.03.01.16.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 16:05:28 -0800 (PST) Date: Sun, 1 Mar 2020 16:05:27 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Hellwig , Tom Lendacky cc: "Singh, Brijesh" , "Grimm, Jon" , Joerg Roedel , baekhw@google.com, "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: [rfc 6/6] dma-remap: double the default DMA coherent pool size In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When AMD memory encryption is enabled, some devices may used more than 256KB/sec from the atomic pools. Double the default size to make the original size and expansion more appropriate. This provides a slight optimization on initial expansion and is deemed appropriate for all configs with CONFIG_DMA_REMAP enabled because of the increased reliance on the atomic pools. Alternatively, this could be done only when CONFIG_AMD_MEM_ENCRYPT is enabled. Signed-off-by: David Rientjes --- kernel/dma/remap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/remap.c b/kernel/dma/remap.c --- a/kernel/dma/remap.c +++ b/kernel/dma/remap.c @@ -105,7 +105,7 @@ static struct gen_pool *atomic_pool __ro_after_init; static struct gen_pool *atomic_pool_dma32 __ro_after_init; static struct gen_pool *atomic_pool_normal __ro_after_init; -#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_256K +#define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_512K static size_t atomic_pool_size = DEFAULT_DMA_COHERENT_POOL_SIZE; /* Dynamic background expansion when the atomic pool is near capacity */