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 1498FC77B75 for ; Tue, 23 May 2023 09:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjEWJzT (ORCPT ); Tue, 23 May 2023 05:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236432AbjEWJyl (ORCPT ); Tue, 23 May 2023 05:54:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56111121; Tue, 23 May 2023 02:54:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DF46C61447; Tue, 23 May 2023 09:54:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E4D0C433EF; Tue, 23 May 2023 09:54:14 +0000 (UTC) Date: Tue, 23 May 2023 10:54:11 +0100 From: Catalin Marinas To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Christoph Hellwig , "Michael Kelley (LINUX)" , Petr Tesarik , Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Marek Szyprowski , Robin Murphy , "Paul E. McKenney" , Borislav Petkov , Randy Dunlap , Damien Le Moal , Kim Phillips , "Steven Rostedt (Google)" , Andy Shevchenko , Hans de Goede , Jason Gunthorpe , Kees Cook , Thomas Gleixner , "open list:DOCUMENTATION" , open list , "open list:DRM DRIVERS" , "open list:DMA MAPPING HELPERS" , Roberto Sassu , Kefeng Wang Subject: Re: [PATCH v2 RESEND 4/7] swiotlb: Dynamically allocated bounce buffers Message-ID: References: <346abecdb13b565820c414ecf3267275577dbbf3.1683623618.git.petr.tesarik.ext@huawei.com> <20230516061309.GA7219@lst.de> <20230516083942.0303b5fb@meshulam.tesarici.cz> <20230517083510.0cd7fa1a@meshulam.tesarici.cz> <20230517132748.2e250f9c@meshulam.tesarici.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230517132748.2e250f9c@meshulam.tesarici.cz> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org On Wed, May 17, 2023 at 01:27:48PM +0200, Petr Tesařík wrote: > On Wed, 17 May 2023 08:35:10 +0200 > Petr Tesařík wrote: > > Anyway, my greatest objection to allocating additional swiotlb chunks is > > that _all_ of them must be searched to determine that the physical > > address does _not_ belong to a swiotlb, incurring performance penalty > > I thought about this part again, and I overlooked one option. We can > track only the _active_ swiotlbs for each device. If a device never > needs a swiotlb, there is no active swiotlb, and is_swiotlb_buffer() > short-circuits to false. This should avoid all collateral damage to > innocent devices. Does this work with dma-buf or does dma-buf not allow swiotlb bouncing? -- Catalin