Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2245281ybl; Thu, 9 Jan 2020 09:17:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxLm4hXTT4W+HYDakT24f5CJ1zsg8K0qkQN9WBfaWvpY9Qb5K0Ps/tu0wsQY78aXc1il7p6 X-Received: by 2002:aca:ed57:: with SMTP id l84mr4130482oih.8.1578590230996; Thu, 09 Jan 2020 09:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578590230; cv=none; d=google.com; s=arc-20160816; b=oHNL+xS4waT6iAm9Ah57yKs1RX1bM0LVg4avxpbAWQUAWRjWxwclWsnEc5NgNWknj5 eiyTiJUhCbaSei68344aXjy5LpyR7XLYOiyb1byMni4j7av+6qVVaWcOkVBpCs0Q7GF3 Sg7AWOnJbwKQKLAfpU5tQG79sPZJUVTz0u2mGsJvwJGp+0uk4CRs5YENLd2eyEExGVcn aL4uWoj0/VYmC+TDldIgK7EdBq8oFdYXwmLjaolWfrErWmJIFolyQH4MgmNK5nPqjZ4a FntVUnEECcZ/52f6uayfxALGCSxF5MjLb28lrNW6r8An4GUTrrVWhs4p7oK0E+xUdQEw IsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xWBhnusff36+L/EWV7L14nUCfKtBLW703I0GISRHEdc=; b=ixkHWlTmdBcJchydN2ppsVhHz2SJrWc/kcRwshFgLrYI/HWJn99aUC4yHEBGyvy7NC Ic5LhMLtT7ezMyjQtVU9opaaAWstaTAe3fNX8bW9pcWRhVTcwzBXqzwFGSmVOiuKouYk aYna6YdJ++NLK/mXAus3D/RvnrfTrtrHqNrs39G4xFEK/geODNNKTBMWPG9eLkN2cKRa 76OXTmcE6zN1B8QhT2UuF7iMdC/gEhTGUTLx+SPdMWlG32oLClL7PvxzXjkOdE73Dx3r y3PKCPK+UCDXfSr7jFmtmV/ONmdynhhGX8dz0uhNFchx3R1w1W0IGD17KtnKBujz5zmh n87g== ARC-Authentication-Results: i=1; mx.google.com; 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 v19si6102583otf.81.2020.01.09.09.16.57; Thu, 09 Jan 2020 09:17:10 -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; 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 S1731687AbgAIObL (ORCPT + 99 others); Thu, 9 Jan 2020 09:31:11 -0500 Received: from verein.lst.de ([213.95.11.211]:54956 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727854AbgAIObK (ORCPT ); Thu, 9 Jan 2020 09:31:10 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 7011068BFE; Thu, 9 Jan 2020 15:31:08 +0100 (CET) Date: Thu, 9 Jan 2020 15:31:08 +0100 From: Christoph Hellwig To: David Rientjes Cc: Christoph Hellwig , Robin Murphy , "Lendacky, Thomas" , "Singh, Brijesh" , "Grimm, Jon" , baekhw@google.com, "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: Re: [rfc] dma-mapping: preallocate unencrypted DMA atomic pool Message-ID: <20200109143108.GA22656@lst.de> References: <3213a6ac-5aad-62bc-bf95-fae8ba088b9e@arm.com> <20200107105458.GA3139@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2020 at 11:57:24AM -0800, David Rientjes wrote: > I'll rely on Thomas to chime in if this doesn't make sense for the SEV > usecase. > > I think the sizing of the single atomic pool needs to be determined. Our > peak usage that we have measured from NVMe is ~1.4MB and atomic_pool is > currently sized to 256KB by default. I'm unsure at this time if we need > to be able to dynamically expand this pool with a kworker. > > Maybe when CONFIG_AMD_MEM_ENCRYPT is enabled this atomic pool should be > sized to 2MB or so and then when it reaches half capacity we schedule some > background work to dynamically increase it? That wouldn't be hard unless > the pool can be rapidly depleted. > Note that a non-coherent architecture with the same workload would need the same size. > Do we want to increase the atomic pool size by default and then do > background dynamic expansion? For now I'd just scale with system memory size.