From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 19536443A for ; Thu, 20 Jul 2023 08:22:47 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 6B09B6732D; Thu, 20 Jul 2023 10:22:42 +0200 (CEST) Date: Thu, 20 Jul 2023 10:22:42 +0200 From: Christoph Hellwig To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Christoph Hellwig , 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 8/8] swiotlb: search the software IO TLB only if a device makes use of it Message-ID: <20230720082242.GA6932@lst.de> References: <20230720064744.GA4395@lst.de> <20230720100238.58f11c06@meshulam.tesarici.cz> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230720100238.58f11c06@meshulam.tesarici.cz> User-Agent: Mutt/1.5.17 (2007-11-01) On Thu, Jul 20, 2023 at 10:02:38AM +0200, Petr Tesařík wrote: > On Thu, 20 Jul 2023 08:47:44 +0200 > Christoph Hellwig wrote: > > > Any reason this can't just do a list_empty_careful on the list > > instead of adding yet another field that grows struct device? > > On which list? dev->dma_io_tlb_mem->pools? > > The dma_io_tlb_pools list only contains transient pools, but a device > may use bounce buffers from a regular pool. Oh, true. > The dma_io_tlb_mem.pools list will always be non-empty, unless the > system runs without SWIOTLB. > > On a system which does have a SWIOTLB, the flag allows to differentiate > between devices that actually use bounce buffers and devices that do > not (e.g. because they do not have any addressing limitations). Ok.