Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9258613rwp; Thu, 20 Jul 2023 01:59:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlEzwpdWODIhYhSu11EIwG3hv+Xr1Rz0REaRA7jEmLRWTEmhn36GX6gV+cg9s/CLVpX5x/cb X-Received: by 2002:a17:907:1ddd:b0:99b:574a:42b3 with SMTP id og29-20020a1709071ddd00b0099b574a42b3mr1005458ejc.43.1689843557743; Thu, 20 Jul 2023 01:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689843557; cv=none; d=google.com; s=arc-20160816; b=wiPCu/b9uBYfhwS+zT8tLvK0G2rB05eXgOp+67qFW6QBJs/dxw/LPaLqyok944sxs+ mQCK0ph/RGG1TLM5Evkz49w5NsB2pHH0uyTaOKaYiK8T6ldBRbVmDhFSuY1I+N4eqdOF mQjXY8q+DHyCGp9YTpA5dSRRlXYxSvDjjkMd5rpIY8g1eik1Jcqa4Y8JwErWCRe8iMw3 FGzHz00YRHzeC9jwsnppmSOwuSIpX+GsrQymorKw/6e9LmQEtE/PYxWGddZAOoe/Zn1+ ot28QBDUA0fFP9jefFbRgIuNYORv6pcSFPvdk3V6meAe/WWyrxp9aGtf81KJDxYj/qM/ 9l3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0lWpKWZHUFDTSap2yneiCwdWwqHfLiw/ooZrME+u0pw=; fh=LyqWdJWG1bm/O71m+V1vMDlc065qJ00aVhI70SVF35s=; b=SyZGXcftQOcic2wVSSdZRRjovzOh6MTVNQIIkuIQG4Dfw+3XPo8xAanKKqEBNUNP5N Zjin9RA/A3+7TWmYrlw34QvQ3nvxwB9kDrADyiQBtJ67LhqpAzQXh/eKvKmpE1r14qA9 fAo40QME2ska+b4KpfcDQfHie2eyg7oYL2w7w6XwdIrPxpTeFSoP8JeoU1Mx0UjD7n5C sb6cW4KJ8eftcm04HTvsFW9vjuFXCHBXk6uWQFKa3NMfZaEDjKR64BScDBUKalfE2GH+ BD2UVsgNIByvWjUCPRvDMixyHxpBiuWAQJZQqBWJIf2WhYv502M7hLFPHFRHm0B+UF9/ UM3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a170906b29800b00992083e604fsi419736ejz.154.2023.07.20.01.58.49; Thu, 20 Jul 2023 01:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbjGTIXB (ORCPT + 99 others); Thu, 20 Jul 2023 04:23:01 -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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.