From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CE7DC4332F for ; Tue, 8 Nov 2022 07:50:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 694856B0071; Tue, 8 Nov 2022 02:50:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6453D6B0073; Tue, 8 Nov 2022 02:50:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 534066B0074; Tue, 8 Nov 2022 02:50:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4054E6B0071 for ; Tue, 8 Nov 2022 02:50:18 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 15E9C1C6956 for ; Tue, 8 Nov 2022 07:50:18 +0000 (UTC) X-FDA: 80109502116.21.8223D65 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf09.hostedemail.com (Postfix) with ESMTP id 8149E140008 for ; Tue, 8 Nov 2022 07:50:17 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 5820E68AFE; Tue, 8 Nov 2022 08:50:13 +0100 (CET) Date: Tue, 8 Nov 2022 08:50:12 +0100 From: Christoph Hellwig To: Catalin Marinas Cc: Christoph Hellwig , Linus Torvalds , Arnd Bergmann , Greg Kroah-Hartman , Will Deacon , Marc Zyngier , Andrew Morton , Herbert Xu , Ard Biesheuvel , Isaac Manjarres , Saravana Kannan , Alasdair Kergon , Daniel Vetter , Joerg Roedel , Mark Brown , Mike Snitzer , "Rafael J. Wysocki" , Robin Murphy , linux-mm@kvack.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 03/13] iommu/dma: Force bouncing of the size is not cacheline-aligned Message-ID: <20221108075012.GA22830@lst.de> References: <20221106220143.2129263-1-catalin.marinas@arm.com> <20221106220143.2129263-4-catalin.marinas@arm.com> <20221107094603.GB6055@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667893817; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Bj6n5apnmQNnYKtVMWZHvym2fhT7tx48Zo8RyifqPdo=; b=sYgbt1ImZtR4GOVCQAii/mzL/unp8NY4cg9B/ToeylqX2XFOBLKaPTr/YSeAufi4WQII3d 61RoyMHDtvoW0Nw/m/Uak1OwtBw4hT0AhZr2QiqJChP7fil0wx67++LYtS7abcI+jpORdP 3xFphAj0CcJKkBiXHmZtqn95g3C/C8M= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=none (imf09.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667893817; a=rsa-sha256; cv=none; b=PbmpB4esnCpSyp82Q2kaCPrKu6HfrApLOSzF4GPihRvfw4HW3eZ93hg1OoSkBf1PzRFTTT lLT7qmA09wbQNaVvhJ7IgG9OLVbejtNW9HlA+hWRKWmMNpqAOtMpvCyf4DoOqSoCmCHYSO 1HI3gmdhKGZxiTUrfu3zO8JCNGDIZOQ= Authentication-Results: imf09.hostedemail.com; dkim=none; spf=none (imf09.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8149E140008 X-Stat-Signature: uogthcp31owgswrmcxuywcuwajmgadju X-HE-Tag: 1667893817-877524 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 07, 2022 at 10:54:36AM +0000, Catalin Marinas wrote: > An idea: we could add another member to struct scatterlist to track the > bounced address. We can then do the bouncing in a similar way to > iommu_dma_map_sg_swiotlb() but without the iova allocation. The latter > would be a common path for both the bounced and non-bounced cases. That would be a pretty massive memory overhead for an unusual case, so I'd rather avoid it. In addition to the long term plan of doing DMA mappings without a scatterlist..