From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C448FEB64DC for ; Thu, 20 Jul 2023 08:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231475AbjGTIXA (ORCPT ); Thu, 20 Jul 2023 04:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjGTIWs (ORCPT ); Thu, 20 Jul 2023 04:22:48 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7322110; Thu, 20 Jul 2023 01:22:48 -0700 (PDT) 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> 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) Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org 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.