Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp826806rdb; Fri, 1 Sep 2023 05:33:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzZjd7615h45YaYmutys0hwQsUjjs4PzO/oWTHEYgTjPZJZdlaWbLhi3fnx3+wZFJpxbV0 X-Received: by 2002:a17:906:29e:b0:9a5:7bb5:9f5b with SMTP id 30-20020a170906029e00b009a57bb59f5bmr1775741ejf.62.1693571617643; Fri, 01 Sep 2023 05:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693571617; cv=none; d=google.com; s=arc-20160816; b=ZdxKjj+dW21QBtqXJLlsWswPQV7/k/vibJONDQii9Cse74I8wUSskjZpg3didWKU+5 jurs5UhMC1OQOODoHi9EeBoisC5uILRoNWvFBVbuNzdTnVlGix1WXI8fqpKViVALQoqj OwWKvuv3ttaV9JEkP/+oi+kOouF7mxfZplh+bIXTBbkVa7s25n4tL+Qjx/DEWqKI/H14 G1nSScpYNB7l70TWgJxbxSREZg1nruv/8EP7DR80gz5ekL5LLmcLtDNipgX07mQzTp73 0UcZ57C2IHc21/t9VKrSwa3hA1TsMNndei4JeICEDryYX4zz9eSKtcxcIVIXdgfzHbjK h66A== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=PzqccAgTnC2wqigtMsMGnsUlxawk3s1cXcT34hS2R14=; fh=Z46e9I9vkQfxHXKXsPOr2ti0jaui+RB0vm1ygqoPzKQ=; b=DidH0p3i7CmcCgeQXDhgpIHfWPINOSoBUq6Esryl8637jD/S05NvjvMg5sfBZg/z5J 6UBffKW7mLsy5Q8a9YYuYQyUKxWnSpwZ09ARxPr8N6f7bumCpDIuIxHPxUCkRxZZCcaY y+yJ2hCAVKyXEiBGzIdrXmiWtt0z2PzDAjo0NGl5Z8gJlo/qO9maCcl0n1B9p+63AWmx 4iFTS3/I+QnI3ua7CX4fmIRzGy5lhm/fXh6URSWe8j4vPOF/IhREPoYqFHI6Qt+cLU9g ZCt7GnSh4PlIQwLmkFxkwXQdP4oPAM0waFeJyIGoChsjaYTbUxrqkaodSZQQnMESvkdx kmJg== 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 kj27-20020a170907765b00b009a1e1f41394si2304457ejc.209.2023.09.01.05.33.28; Fri, 01 Sep 2023 05:33:37 -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 S245547AbjHaMv0 (ORCPT + 29 others); Thu, 31 Aug 2023 08:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbjHaMvZ (ORCPT ); Thu, 31 Aug 2023 08:51:25 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 972D4CED; Thu, 31 Aug 2023 05:51:22 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id C99B468C4E; Thu, 31 Aug 2023 14:51:10 +0200 (CEST) Date: Thu, 31 Aug 2023 14:51:09 +0200 From: Christoph Hellwig To: Jonathan Corbet 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 , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Petr Tesarik , 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" , "open list:SLAB ALLOCATOR" , Roberto Sassu , petr@tesarici.cz Subject: Re: [PATCH v7 9/9] swiotlb: search the software IO TLB only if the device makes use of it Message-ID: <20230831125109.GA11562@lst.de> References: <87a5uz3ob8.fsf@meer.lwn.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a5uz3ob8.fsf@meer.lwn.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 Wed, Aug 09, 2023 at 03:20:43PM -0600, Jonathan Corbet wrote: > > spin_unlock_irqrestore(&dev->dma_io_tlb_lock, flags); > > > > - /* Pairs with smp_rmb() in swiotlb_find_pool(). */ > > - smp_wmb(); > > found: > > + dev->dma_uses_io_tlb = true; > > + /* Pairs with smp_rmb() in is_swiotlb_buffer() */ > > + smp_wmb(); > > + > > ...and here you set it if swiotlb is used. > > But, as far as I can tell, you don't actually *use* this field anywhere. > What am I missing? It's very much unused. Petr, I guess you wanted to use this in is_swiotlb_buffer to avoid the lookup unless required. Can you send a follow up?