Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9258220rwp; Thu, 20 Jul 2023 01:58:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFrcRp/dX60Ll5AyWn6xYdBTQA9g0iTWMY4LlLuARYG9npDtydds8xKpSL+Shm8RFtsW+Uu X-Received: by 2002:a17:907:9452:b0:992:9d41:875b with SMTP id dl18-20020a170907945200b009929d41875bmr1920473ejc.32.1689843521077; Thu, 20 Jul 2023 01:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689843521; cv=none; d=google.com; s=arc-20160816; b=U4z+wZ/H5MdCL4PIQNCDZfFSYc7NOAm2steqoR5XDnrooYOMKSAQUsKV4fHhTOpeeT UuzlALWXWIPXlWLa+JXqavBlD4/s8O4v3bNLeGJwuAt3j4mK7Z2IwDS1K2GpJ2NVTkQg XtWw8Gk8G10FtNa+qhqyFiN66bjQWo+9cm/s53ZtLTDMbdDhywF8Zzmt2uOlBMfajP69 t/8D9HL7Eis8/FIlE7IjtzIbjteuQ/aYfFkPeAKJtCY2C5pynvMTdIOUs8WEMS98xZm7 GR9Gwu4uudOc7QUEiFE9P70W+Ci4Gu9EiUHJvDqgFsLLOreF75di4/JV1O1Q7df56Cei 9R1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=D7uejbPnusryYbx96m6L7cjLYp5Gmplm0qfp8geBlY4=; fh=K+AqHgYRl0EeFK0LkJF4lWkjRojzETovX4qpZb+Y5UQ=; b=ZenQzVXpq2FAMfH8yx1rHthL5AF/6iD8lmN0llRArhK7mUIdGHDl6DGC50OIgh5DSN /NSH/OdR02AvpK5adLRtV2+rrERF3dPPBr/0WV5qM4/J1+u/HIrGYUSUrbFWq/0/g6qp vmb37gO94HQaW85WuPz259+mpH9ozi2DXuoYzL69EB4K/wInLwDvkm4bnaibqZWG3ot0 1/5q0Pf9mNieljMRmLTE5ISDEXc9AT60RqEqpW32dwtRNn8BXasvm/Hlw3zgfV5Vo97w ogyBLhIVl+jZxgHe6pmAVgwTBbZ/CCDbw/4psVNr8zqVB0yDJz++jUDNHFAnXLLrRd26 MsEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=y5azLUXF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020a17090694d800b00992bfd00fdbsi368002ejy.971.2023.07.20.01.58.15; Thu, 20 Jul 2023 01:58:41 -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; dkim=pass header.i=@tesarici.cz header.s=mail header.b=y5azLUXF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230487AbjGTICo (ORCPT + 99 others); Thu, 20 Jul 2023 04:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjGTICm (ORCPT ); Thu, 20 Jul 2023 04:02:42 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1646D135; Thu, 20 Jul 2023 01:02:42 -0700 (PDT) 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 3ECD7164269; Thu, 20 Jul 2023 10:02:39 +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=1689840159; bh=D7uejbPnusryYbx96m6L7cjLYp5Gmplm0qfp8geBlY4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=y5azLUXFqHfPiDcwLhK9RwnD6ejtiZ+5Q02Bj+zd22Fr+LTkHaT722JMUBsOsMObf d/uJjgs0CGt4ina28Lmi+hf5m9guZ+TRvuODDbwcLdrHc3ABi2F9r9nWpfci2kQrla Z2yA0zYxxpDaId3rWBew7EufpvEwO7go1DmYHTMzHoRlZ7WPskE92l6RVNhUeRWnKg fKAg7BCd5Gjf6KvOFOw4bkEQUU4pOxankJGS7I9GPQu8i9MLEdtCZumfu7B6IuuFen OKCplt0boWwWvjkRP8KQZMs+QBemLE/Tga0vCGYkGNdPfyg0bvUJ2CxXY0zZ+Agu45 DanUaK6MSjTxA== Date: Thu, 20 Jul 2023 10:02:38 +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 8/8] swiotlb: search the software IO TLB only if a device makes use of it Message-ID: <20230720100238.58f11c06@meshulam.tesarici.cz> In-Reply-To: <20230720064744.GA4395@lst.de> References: <20230720064744.GA4395@lst.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,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, 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? The dma_io_tlb_pools list only contains transient pools, but a device may use bounce buffers from a regular pool. 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). Petr T