Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36553805rwd; Tue, 11 Jul 2023 02:32:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPJBPdf/lPJAfFrbQytu5In+Sb4DIRicvPK9fS09BGc0znJb1WrQYzb8z74BX8pe5NczFt X-Received: by 2002:a17:90a:588b:b0:260:d40f:6ade with SMTP id j11-20020a17090a588b00b00260d40f6ademr14465980pji.15.1689067919914; Tue, 11 Jul 2023 02:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689067919; cv=none; d=google.com; s=arc-20160816; b=sURFMB3/C8Ywz1FDGfi8mz9s8j49c/MzHqn13fLxmImAGnx/j2eNKzwpKTSNOv7Wih tTFKrNwfPbXElVDJ/v7LCf79NjEllk4abY1n1nB06ieqnXwEub0OW/jxxwofjm/ynaKJ i+cBDT+Gg4CFHmg7FnBeXebbarO4JRTWJU1yoLx5zxi+epw6B3rLz+doaM3neo9E6aiH kKleSiJbm0o3bK4BSWtUp4vBalAw0ZvLC9/WWUh415wd8L70PJDTHnI2gu6ZNj6rXb+M J+PsqGl6D8rOEa7di1DVSEE0BMkol8CsXgfrEv1K3y9s/stGNC363KLkiBV4di+ga9bv 6Rwg== 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=oyN3d3+pxC7eGsawiIhwvTQ5mv0iMpCVzgh6PiyDtBM=; fh=H6emAYbPA2ALh9mpeaD4jtR5JqpYwsoFARM14kClhU8=; b=n5+vNVte5AyK7PY2+gVNItbtpKcF77bJ7U7SRmROvtdo9ER29vp30XwU9Zq84ff3ZY pU+GeHMwbWkY4mUNZNAHi/8Lt3B2HPEjAf2Q6OQT1qPCiNS7YTtS7cO/r8LpDHIP5kzY hBXql41vSDzJGjNqyRWiCZu3hqWLkNlKKUEWaWp4CQkehTmUBNngpR0fsN6jPkD5qSSx NWEHKtFTh+IZfz7R3caHTk0QkkAGOo959XkVB8DcV8JYLrDLYL7bStAQU8ln8tGY9gGB ZNpc1Mq6UUVJ9eLV5kEhrF9/XGOjaMhaTi0JTWxlYijAWWIFLn6muyOhxHIMH3yF75Nt u3kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=lTBkHMaR; 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 pj8-20020a17090b4f4800b002639acf55c7si9333749pjb.7.2023.07.11.02.31.45; Tue, 11 Jul 2023 02:31: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=lTBkHMaR; 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 S231817AbjGKJDh (ORCPT + 99 others); Tue, 11 Jul 2023 05:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbjGKJDd (ORCPT ); Tue, 11 Jul 2023 05:03:33 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B550E94 for ; Tue, 11 Jul 2023 02:03:31 -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 898F7148CBE; Tue, 11 Jul 2023 11:03:28 +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=1689066208; bh=gsA9dp5k5kL6wVwYiuNLHaFWo2zidgNfMjsDqoPRfvA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lTBkHMaRlvYY4xPel/M5UCaSWW2SpSEVRze8dKTgfvPMmQjjKLQWBbnq/UQmT/PLp soZ+v+Dw+CTEepA07g799v8ScO+hduASLM0Yjiu3042TsoZyXTY5QAKlvZlOuFztnw 18Zo87nEx5fPnDo9NL6xeVMqf9WgPD4fE43YjpSfOVyNAS7dp6Qfa1V35r7nY8Tfc7 N38JwA/go6jlLM8Cre6j+8YtiQLsv+LbXML9iDs0vDTsx+R/J/ltuUGPmJ9E0MNdZN YTmb0OsxoWAFfBth1siEGkEJMU6UuUaTpcMFuxc+W5gqSoxM7jg3dQWoymWJyFkfX9 Zy4tguasNPMiA== Date: Tue, 11 Jul 2023 11:03:25 +0200 From: Petr =?UTF-8?B?VGVzYcWZw61r?= To: Mike Lothian Cc: Roberto Sassu , Kefeng Wang , "open list:DMA MAPPING HELPERS" , Petr Tesarik , Roberto Sassu , open list , Thomas Gleixner Subject: Re: [PATCH v2 0/7] Allow dynamic allocation of software IO TLB bounce buffers Message-ID: <20230711110325.2521472c@meshulam.tesarici.cz> In-Reply-To: References: <20230426141520.0caf4386@meshulam.tesarici.cz> <2023042617-wobble-enlighten-9361@gregkh> <20230426144439.5674f8bc@meshulam.tesarici.cz> <20230509091635.27450bd9@meshulam.tesarici.cz> <2023050949-grueling-verify-a43b@gregkh> 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=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,RCVD_IN_DNSWL_BLOCKED, 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 On Mon, 10 Jul 2023 23:23:45 +0100 Mike Lothian wrote: > Hi >=20 > I was hoping this might land for 6.5-rc1, is there a new version that > might apply against 6.5? Yes, there is a v3, which is a complete rewrite based on feedback from various people on this mailing list: https://lore.kernel.org/linux-iommu/cover.1687859323.git.petr.tesarik.ext@h= uawei.com/T/ Petr T > Cheers >=20 > Mike >=20 > On Tue, 9 May 2023 at 08:32, Greg Kroah-Hartman > wrote: > > > > On Tue, May 09, 2023 at 09:16:35AM +0200, Petr Tesa=C5=99=C3=ADk wrote:= =20 > > > On Wed, 26 Apr 2023 14:44:39 +0200 > > > Petr Tesa=C5=99=C3=ADk wrote: > > > =20 > > > > Hi Greg, > > > > > > > > On Wed, 26 Apr 2023 14:26:36 +0200 > > > > Greg Kroah-Hartman wrote: > > > > =20 > > > > > On Wed, Apr 26, 2023 at 02:15:20PM +0200, Petr Tesa=C5=99=C3=ADk = wrote: =20 > > > > > > Hi, > > > > > > > > > > > > On Wed, 19 Apr 2023 12:03:52 +0200 > > > > > > Petr Tesarik wrote: > > > > > > =20 > > > > > > > From: Petr Tesarik > > > > > > > > > > > > > > The goal of my work is to provide more flexibility in the siz= ing 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 sufficien= t 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 wi= thout > > > > > > > changing device drivers. The software IO TLB size is increase= d 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 n= ot 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 redu= cing > > > > > > > the SWIOTLB size. This can be achieved with a kernel paramete= r, but > > > > > > > determining the right value puts additional burden on pre-rel= ease > > > > > > > testing, which could be avoided if SWIOTLB is allocated small= and > > > > > > > grows only when necessary. =20 > > > > > > > > > > > > Now that merging into 6.4 has begun, what about this patch seri= es? I'm > > > > > > eager to get some feedback (positive or negative) and respin th= e next > > > > > > version. =20 > > > > > > > > > > It's the merge window, we can't add new things that haven't been = in > > > > > linux-next already. =20 > > > > > > > > This is understood. I'm not asking for immediate inclusion. > > > > =20 > > > > > Please resubmit it after -rc1 is out. =20 > > > > > > > > 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, becau= se > > > > getting all existing DMA fields out of that struct will take a lot = of > > > > time... =20 > > > > > > All right, 6.4-rc1 is out now. The patch series still applies cleanly. > > > > > > Any comments what must be changed (if anything) to get it in? =20 > [...] =20