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 F343DC25B41 for ; Mon, 23 Oct 2023 05:59:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C7346B00A9; Mon, 23 Oct 2023 01:59:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 278156B00AA; Mon, 23 Oct 2023 01:59:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1661A6B00AB; Mon, 23 Oct 2023 01:59:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 0709F6B00A9 for ; Mon, 23 Oct 2023 01:59:59 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CB0DDC092B for ; Mon, 23 Oct 2023 05:59:58 +0000 (UTC) X-FDA: 81375675276.27.D544589 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf18.hostedemail.com (Postfix) with ESMTP id EBCF01C0010 for ; Mon, 23 Oct 2023 05:59:56 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698040797; 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=YSpffGsL2jBYJ7k+m5xd2yyUNmMPy0/aIUbM/6Bx0t0=; b=mQUzVbAI83ISteD6NCICAPsYa+1UrnlKXIi91aNiKRcDmnp/KMFmlymA9699j2BwfaDX8P 3VsAMAFxCJwZG5nsMu+LzOU26w0DsckB163u+aLMjw36ZfI7bc85N8mCpq0+Z+Jk50ZTdV 3afqt+t6UefsykufFwwIdEeyU84dUoY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of hch@lst.de designates 213.95.11.211 as permitted sender) smtp.mailfrom=hch@lst.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698040797; a=rsa-sha256; cv=none; b=5vm1HoDB40Uo/uySpdOlb44625yznW7biTvrBCg8JUi2Hx7h5FOTqvZhNhUuUgSme+d8rr zT+7m6cTaKA30phj4iTlL3B8wF+uG54ZYu41FSjDjOt18pRn4VJg/k9oHkpWgUXa9qPB/G aLwV7N3PKelMCxTdaTJFZcBmqPuYC3Q= Received: by verein.lst.de (Postfix, from userid 2407) id 2FE7368AA6; Mon, 23 Oct 2023 07:59:52 +0200 (CEST) Date: Mon, 23 Oct 2023 07:59:51 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Matthew Wilcox , Chuck Lever , Marek Szyprowski , Chuck Lever , Alexander Potapenko , linux-mm@kvack.org, linux-rdma@vger.kernel.org, Jens Axboe , kasan-dev@googlegroups.com, David Howells , iommu@lists.linux.dev Subject: Re: [PATCH RFC 0/9] Exploring biovec support in (R)DMA API Message-ID: <20231023055951.GB11569@lst.de> References: <169772852492.5232.17148564580779995849.stgit@klimt.1015granger.net> <20231020045849.GA12269@lst.de> <41218260-1e5f-4d36-8287-fc6f50f3ec00@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41218260-1e5f-4d36-8287-fc6f50f3ec00@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Rspamd-Queue-Id: EBCF01C0010 X-Rspam-User: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FMMLTFKd78VBY+ZiLX+oYrQliJhpB5IDQhWaXWJ9ONg1WUQuij1mE6MElL6WJ4VNuPye2LrT6LL2V2t+JRKWHwcY3Reh/df9LMOmBKVT+Dd781wVhvwDEO6eDnLu0v9BkH4pR1VRCfS0VeLW797Q8h2BccAftiyqiuUo 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: List-Subscribe: List-Unsubscribe: On Fri, Oct 20, 2023 at 11:30:06AM +0100, Robin Murphy wrote: >> Well, we can stage this. I wish I could find my old proposal about the >> dma_batch API (I remember Robin commented on it, my he is better at >> finding it than me). > > Heh, the dirty secret is that Office 365 is surprisingly effective at > searching 9 years worth of email I haven't deleted :) > > https://lore.kernel.org/linux-iommu/79926b59-0eb9-2b88-b1bb-1bd472b10370@arm.com/ Perfect, thanks! > The other thing that's clear by now is that I think we definitely want > distinct APIs for "please map this bunch of disjoint things" for true > scatter-gather cases like biovecs where it's largely just convenient to > keep them grouped together (but opportunistic merging might still be a > bonus), vs. "please give me a linearised DMA mapping of these pages (and > fail if you can't)" for the dma-buf style cases. Hmm, I'm not sure I agree. For both the iommu and swiotlb case we get the linear mapping for free with small limitations: - for the iommu case the alignment needs to be a multiple of the iommu page size - for swiotlb the size of each mapping is very limited If these conditions are matched we can linearize for free, if they aren't we can't linearize at all. But maybe I'm missing something?