Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16218195rwd; Mon, 26 Jun 2023 07:15:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5jeimdpD/2uzdfRqDTG3VzEluogv6kD7cRsQtBcrBREhA0l2YvrfrevJehg3SPCkDOHwZd X-Received: by 2002:a17:903:230f:b0:1b8:1636:b26 with SMTP id d15-20020a170903230f00b001b816360b26mr117116plh.3.1687788959286; Mon, 26 Jun 2023 07:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687788959; cv=none; d=google.com; s=arc-20160816; b=Kz7UoZyPe3zx0/cUs2dwjWkJsk9w22edNRgu6VN79cfB/+c5swFjcAkD1WeioA0w37 Ti0iHCrtMEgjQhyZ1ycrLSMA99VzMjMYluwZnFj6bRKckkARXNtxYgUyUi209iKSkq30 7pI24wpEUOK/7q5QNCkZgJ9T89wBCEvUDUnLiMdwB+HzlfJCd0p5rOBxNvzYAKhbtd3k jq/OdKKYkD7pxwA8tWgaFYhX7pCO1wTuTDV1UqwrX7mtxU6z89wLNCe6RwLQpndFu9Ib ci/e0aSHoB8Aj5UCwS9QZ9/2OLUnTGh9rUp1Gy+aq8a7AaE7pU6uY+Uezj7OjkfSbJrI MaGQ== 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=WBJbnnk4/fJt1yJSu35frhDKSZ0vKUfXkrA2hTt6k4k=; fh=dZAhCWB0e/m7ECjEjNCeR37kXm8OuFJpsT1JQKMloSs=; b=xMO3oYm3tXD9vtBYKzTafgPlTnTZAoBGUaHoLnPyTmG3dfARgdrY3jpqP5MB/P1cN/ aLIYBJoYXzNVTqvmw3ysf0WKmNOLvv4HT2rexOIHZlQZdEOBn3h9ZBZovvDrvTAKK4qw HSO+IYNCUAm7FzGGBzWuVDn3hQEK/baBhhQZecSOrxtmD/5QCdIJdiMmyw5D3ZZBqhOL wfaWdfDJD5aKCsoUrI9NHIVEjbJpONpf+X5hfl5rlyYcpTD7VfSrlv9TBDojj6llhy4z DGYjAa7pK34rG/FA7NAGkV96plJ8oIGYcqIh6/imINpMQVhleVY9Z3+qBuSsZfb2wQvs KauQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=QJMzGwTg; 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 w4-20020a170902e88400b001a6dfb34f8csi5259617plg.305.2023.06.26.07.15.46; Mon, 26 Jun 2023 07:15:59 -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=QJMzGwTg; 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 S229737AbjFZOHe (ORCPT + 99 others); Mon, 26 Jun 2023 10:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjFZOHd (ORCPT ); Mon, 26 Jun 2023 10:07:33 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F6AB193 for ; Mon, 26 Jun 2023 07:07:32 -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 66F688B11E; Mon, 26 Jun 2023 16:07:27 +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=1687788447; bh=FILL/HLjSg/GDNwutDPaxm/toIQ/PWb8bUfurR9PFH4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QJMzGwTgMOXIVQ7F16kYj0bofTEB1DLXPNaCa2ivRDPDS4KWwWKLImRWQ0vJaxAIw D/Ve629p9/aQwiMR+o/UBv7iEYYxiLpXTD75PDGfouuxVKOsxH/5GWZgM/5oFOC7vk D8lj/F9p5uGZ7roqOaKP9dcOUTLapDOAgLJEv2PH8jNchQiISCb9R9GRuH1C7cTRzX zc0y39OrYAzQMbI/u4ULm3aL4eWhh/pV2wliXafcCVfYK7amxkSnyYpcRL4RWtwwks SK4CWdLnGwQQvbWmmPGsL1bfZ3nM4+47MuzcRA5URxL+JXFs1Ka3EcjGkMth2G1tst c3fjez+Ol+Avw== Date: Mon, 26 Jun 2023 16:07:25 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Petr Tesarik Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux.dev (open list:DMA MAPPING HELPERS), linux-kernel@vger.kernel.org (open list), Roberto Sassu , Kefeng Wang Subject: Re: [PATCH v1 0/2] swiotlb: Fix a couple of bugs in sizing areas Message-ID: <20230626160725.5164ca74@meshulam.tesarici.cz> In-Reply-To: References: 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,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 Mon, 26 Jun 2023 15:01:02 +0200 Petr Tesarik wrote: > From: Petr Tesarik > > While reworking the dynamic SWIOTLB implementation, I ran into some > locking issues with the current implementation. I believe the bugs > are serious enough to be fixed separately. As an aside (and not directly related to the bugfixes themselves), I wonder why the area size cannot be always equal to IO_TLB_SEGSIZE. Of course, we would (usually) end up with more areas, but that should be a good thing, shouldn't it? The area structure is quite small, so it cannot be because of memory consumption concerns. The overhead of taking an uncontended spinlock should also be negligible. Do I miss something important here? Petr T