Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp727556rwr; Wed, 26 Apr 2023 05:46:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+w3Ib8pUQDCCXvy1w+SyDbhVPkbYC71oFRnU+53n5cDOfXCfWdGyvzl4qFXKhh3xLlDTM X-Received: by 2002:a17:902:d50c:b0:1a9:4cd5:e7e0 with SMTP id b12-20020a170902d50c00b001a94cd5e7e0mr2883912plg.17.1682513202415; Wed, 26 Apr 2023 05:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682513202; cv=none; d=google.com; s=arc-20160816; b=OfcvUKyYoujOyCCKH1X6emSJYd2jpUDznkIlkb5LzzfD+8UhQTC5TjQlcyqgIL76vs sWesdO3nZ3uQZGOl0IVG+GjnO/LdcP7jhX8vbnEXEhHR/9DYS4ayeXVCvCvmWydhD6WU UBiJUBhsLyy+NrFLObr/0S5VA3qzyOxWVmh1U7z6sfKkg4xerthE6gUunkpOl6OjO7CS Bx+GBGqKZWUymO9yK/qlNDMMbFO89YHdyVZounlDuuR/uypCGlEi33Nml736uZ0iQJD9 9QFu/q+yCcX4Aekqv5MSyqBP5IRUbfyrB2T0NrYGIxaeTl6BHIzPnr75f8jeIRsOp2KJ S3UA== 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=qbO6qW2al5VPdaJ4Fglrj9vUUzyEB0+3iGCmKqVQ+gA=; b=dI4LGDBc8HW5ksOtP1qFRmX3LkFXOGQY1S6NuYHVoI+8WOQcCvLhaAs77dtYpX/XZD 8Sq6dQCjCQokNcoSF3YcGE0+tTiLPG3SYE/7+ZEn7MzjCPUMGjX6pCe4UC8RyIgZdeSb oUWS5BmiTDVFqapdbKvReql2qEGrrIOLx5Q7U/RhH4lmGwu4yWfbBFTUeiSmFBr4DzVK IKn5KHRtjF08krxMtcqWBOICzrrsG7QCHb02wJXbph1Jz+zLrtA8NOHnhkSS5MvhCBrB S7/X3VSMqjsizCddUHotoau8GHsSA+pOxPA7dRr+fYp77pcl276Unv6PjXPY6bWIEPsD xvuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=W9ZadZpo; 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 k1-20020a17090ac50100b0024b6ee72f16si12678615pjt.133.2023.04.26.05.46.30; Wed, 26 Apr 2023 05:46:42 -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=W9ZadZpo; 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 S241058AbjDZMpp (ORCPT + 99 others); Wed, 26 Apr 2023 08:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241053AbjDZMpY (ORCPT ); Wed, 26 Apr 2023 08:45:24 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F84765AC; Wed, 26 Apr 2023 05:44:45 -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 CA0C9165337; Wed, 26 Apr 2023 14:44:40 +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=1682513081; bh=TUvWyN8jrQgQ7QsrJmJ6ZjN4uMqDIuUrXKhGCfiOkT4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W9ZadZpoOR/aiQ3ArOSxYlCe4i81AoAJ2X36fC/6cYva7r6B6NKzsh7xS8FB1MZCA ghC5/ZaJl5If6DnpEnLvxseVebYHoee5ytSORNXCiH4AvSGmzfow6fTL5xG21KGXKr 3MBq6vh3NSBopuWhUDcbCWpJNFjf9JcqlWLT+Gz6oy7HG/11IwZTrJNDomATw8u7a2 gDdYRuHACnfzoQ5c99yHxDV8QCfKWZFD+7KKEK1eGLWUbdaJuSXF+KBMAqFghkrW/D s7GKjvo14gtjI37/6t8zfyh9wWDL7tHklrNDb2N8mrGVRNlAbxkS84kZ1lvFwVMR7h /O8vY9/sPtH3g== Date: Wed, 26 Apr 2023 14:44:39 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Greg Kroah-Hartman Cc: Petr Tesarik , Jonathan Corbet , "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 , "open list:DOCUMENTATION" , open list , "open list:DRM DRIVERS" , "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: <20230426144439.5674f8bc@meshulam.tesarici.cz> In-Reply-To: <2023042617-wobble-enlighten-9361@gregkh> References: <20230426141520.0caf4386@meshulam.tesarici.cz> <2023042617-wobble-enlighten-9361@gregkh> 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=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Greg, On Wed, 26 Apr 2023 14:26:36 +0200 Greg Kroah-Hartman wrote: > On Wed, Apr 26, 2023 at 02:15:20PM +0200, Petr Tesa=C5=99=C3=ADk wrote: > > Hi, > >=20 > > On Wed, 19 Apr 2023 12:03:52 +0200 > > Petr Tesarik wrote: > > =20 > > > From: Petr Tesarik > > >=20 > > > The goal of my work is to provide more flexibility in the sizing of > > > SWIOTLB. > > >=20 > > > The software IO TLB was designed with these assumptions: > > >=20 > > > 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. > > >=20 > > > 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. > > >=20 > > > 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. =20 > >=20 > > 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. =20 >=20 > It's the merge window, we can't add new things that haven't been in > linux-next already. This is understood. I'm not asking for immediate inclusion. > Please resubmit it after -rc1 is out. If you can believe that rebasing to -rc1 will be enough, then I will also try to believe I'm lucky. ;-) The kind of feedback I really want to get is e.g. about the extra per-device DMA-specific fields. If they cannot be added to struct device, then I'd rather start discussing an interim solution, because getting all existing DMA fields out of that struct will take a lot of time... Thanks, Petr T