Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE7C9171D2 for ; Thu, 20 Jul 2023 08:13:24 +0000 (UTC) Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 6B344166DED; Thu, 20 Jul 2023 10:13:21 +0200 (CEST) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1689840801; bh=TdK9jcZL8v/p/laoEmi/zALu74q142SxfjUGyouwpT0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ep2iGtb9XwwVXdW8lVyOJuD+PoVmPwq3KvBPAUvyUMDZA5m9uc+OP56Pme9dHmPf9 LHSbVYWT2DwuGrfqg10tpCg+WHOsEUxLlBHB4rejKgW1xDrQmwKxTdgmNua/ZkIyCH xxGsUJzTMkwUtfhkUvu+WUcF93Rn0u2BhomMyok4HopTRqI6aPHQIsiOePlRk5yWQs 0rokk+4IQ42uMfAuxqVoxMGN1xbcL2Wy/NC1Kaac/sy0+W5qWYGX9kVu6KE8SRnLaq uU+Ds0EbmORD13mcMi4lyS/k6NmlLzUQvS2oeGXNiOQkSfvv6GsyoshWbeWeP6p6QB 9UMlHjGDhJ+XA== Date: Thu, 20 Jul 2023 10:13:20 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Christoph Hellwig Cc: Petr Tesarik , Stefano Stabellini , Russell King , Thomas Bogendoerfer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Greg Kroah-Hartman , "Rafael J. Wysocki" , Juergen Gross , Oleksandr Tyshchenko , Marek Szyprowski , Robin Murphy , Petr Tesarik , Jonathan Corbet , Andy Shevchenko , Hans de Goede , James Seo , James Clark , Kees Cook , "moderated list:XEN HYPERVISOR ARM" , "moderated list:ARM PORT" , open list , "open list:MIPS" , "open list:XEN SWIOTLB SUBSYSTEM" , Roberto Sassu , Kefeng Wang Subject: Re: [PATCH v4 0/8] Allow dynamic allocation of software IO TLB bounce buffers Message-ID: <20230720101320.72bbd2fc@meshulam.tesarici.cz> In-Reply-To: <20230720065216.GB4395@lst.de> References: <20230720065216.GB4395@lst.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu) Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 20 Jul 2023 08:52:16 +0200 Christoph Hellwig wrote: > Just to add a highlevel comment here after I feel like I need a little > more time to review the guts. > > I'm still pretty concerned about the extra list that needs to be > consulted in is_swiotlb_buffer, but I can't really think of > anything better. Maybe an xarray has better cache characteristics, > but that one requires even more allocations in the low-level dma map > path. > > One thing I'd like to see for the next version is to make the > new growing code a config option at least for now. It is a pretty > big change of the existing swiotlb behavior, and I want people to opt > into it conciously. Maybe we can drop the option again after a few > years once everything has settled. Fine with me. I removed it after all my testing showed no performance impact as long as the size of the initial SWIOTLB is kept at the default value (and sufficient for the workload), but it's OK for me if dynamic SWIOTLB allocations are off by default. OTOH I'd like to make it a boot-time option rather than build-time option. Would that be OK for you? Petr T