Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp708084rwr; Wed, 26 Apr 2023 05:30:58 -0700 (PDT) X-Google-Smtp-Source: AKy350bAoj9p7sCnsGVWovcSAMwXR4m9zwgEpicdS+A6NGlTBvmJayt8GgeFYHKXO9i16BEokaPs X-Received: by 2002:a17:902:e892:b0:1a8:1e7b:2a85 with SMTP id w18-20020a170902e89200b001a81e7b2a85mr27551418plg.52.1682512258039; Wed, 26 Apr 2023 05:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682512258; cv=none; d=google.com; s=arc-20160816; b=i5hsWkx0OpDZq8dd5PMQNgpLmAUUkivvTQEyt82k7hE1g3kU+9omq5G2JaoiJTGiV1 rMKPh6L4BKAT022qQrINaL8ZzujTtXy4mhThZw5Vz6Im9yEQoLed5gXP4XKicKc42IOt ujzlfUbdOpJmdxdT7yuNKjFSbej+AHpYT1JQvpowo5eXqPyA6+vaQDqT/cI/HNQ7vmzp gW6ktMjX4Xh3xdmMwbZMVcXDhPOlaxzM5sIQCpzzc3yTtJ7YtBr4PBH6/v0wR/NohvcM MBgHNnQSfNATBahpuNdzsQnzEMzJmFXtSr3n9HAKtnnvz3KU7/v/PkyaRp69EEX0phFG rzJw== 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=4CiRZXMcEIBfElGNN4iR7LKil2T8tThHN/2Np0PQKes=; b=mKT7tlu8tgVVudmkRhO57Ram0XCzBb1g+7VuZjCJi9VsOxblHJBBCfvSpyKA8WHI/Q ZKQE2e2K9FySToP7DwIV2i4UCztuUGgfbb3hKAgmL2RwrVDIf7wcnIAL6qrKAZeYGn5g jrSyknV9+VnYYKXeYu4bHUsefF/zwRCQfC4592qgS6Ci60uPL18aojGyAoxacQiS+0mK zFsrJB3eBJt3BPM50EOnyD2TJ6BU0xUwkdM8X05c5ZSsu1/iBgDmmB8WG1uK+FDmJPfN 9DQCLvZWx2O7FKpeISmSfVFLzmrb7f3zaKhgtEbhrSLc/M2POhw55+1V0HxljWYumQ8f XcGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=kK6XN5om; 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 y9-20020a17090264c900b0019a74a00baesi15046132pli.87.2023.04.26.05.30.43; Wed, 26 Apr 2023 05:30:58 -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=kK6XN5om; 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 S240812AbjDZMPd (ORCPT + 99 others); Wed, 26 Apr 2023 08:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240806AbjDZMPc (ORCPT ); Wed, 26 Apr 2023 08:15:32 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D322121; Wed, 26 Apr 2023 05:15:30 -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 AAF5B1638D9; Wed, 26 Apr 2023 14:15:22 +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=1682511323; bh=pe2UYZizOeio6nSoi1Td4szdHUc2e4dqr0KHdYi4A/M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kK6XN5om/s4+bL7JgU298eKq8z6ZaYnBhwZ6NHI/7cfcpx+CraI/5CnKciTYPRDaE oNRqFdAQetZP/ZEYqzaMm4g8P7dpOMOdjbMCZ3kfK5KMmuo6JEDZUWA1mjcJk+uJda jq0GI99tm0lPRCrtchUwW5dZR6RwTmoI0T0ZxWrF1i4NXTyYgwKiMjsR1xHFwr0WdF jPYPa50+d84XT3FoddAgv4HS5tAFbFRukSwNOLD6ytM6AWFbu39ZOxAEuCKrPCXFpS R7uOHvYVM5cwzThS34J7vf4y0Jz7GKapbhm91/CG2E/4bhAcuRL3rckqwB4Apsk9UJ vMVuxLErWtiGg== Date: Wed, 26 Apr 2023 14:15:20 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Petr Tesarik Cc: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Borislav Petkov , "Paul E. McKenney" , Catalin Marinas , Will Deacon , Zhen Lei , Randy Dunlap , Damien Le Moal , Kim Phillips , "Steven Rostedt (Google)" , Muchun Song , Ondrej Zary , "Jason A. Donenfeld" , Petr Tesarik , Hans de Goede , Dan Williams , Andy Shevchenko , Kees Cook , Thomas Gleixner , Won Chung , linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list), dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), iommu@lists.linux.dev (open list:DMA MAPPING HELPERS), Roberto Sassu , Kefeng Wang Subject: Re: [PATCH v2 0/7] Allow dynamic allocation of software IO TLB bounce buffers Message-ID: <20230426141520.0caf4386@meshulam.tesarici.cz> In-Reply-To: References: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; 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,URIBL_BLOCKED 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 Hi, On Wed, 19 Apr 2023 12:03:52 +0200 Petr Tesarik wrote: > From: Petr Tesarik > > The goal of my work is to provide more flexibility in the sizing of > SWIOTLB. > > The software IO TLB was designed with these assumptions: > > 1. It would not be used much, especially on 64-bit systems. > 2. A small fixed memory area (64 MiB by default) is sufficient to > handle the few cases which require a bounce buffer. > 3. 64 MiB is little enough that it has no impact on the rest of the > system. > > First, if SEV is active, all DMA must be done through shared > unencrypted pages, and SWIOTLB is used to make this happen without > changing device drivers. The software IO TLB size is increased to > 6% of total memory in sev_setup_arch(), but that is more of an > approximation. The actual requirements may vary depending on the > amount of I/O and which drivers are used. These factors may not be > know at boot time, i.e. when SWIOTLB is allocated. > > Second, other colleagues have noticed that they can reliably get > rid of occasional OOM kills on an Arm embedded device by reducing > the SWIOTLB size. This can be achieved with a kernel parameter, but > determining the right value puts additional burden on pre-release > testing, which could be avoided if SWIOTLB is allocated small and > grows only when necessary. Now that merging into 6.4 has begun, what about this patch series? I'm eager to get some feedback (positive or negative) and respin the next version. Petr T