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 8D804C54E94 for ; Thu, 26 Jan 2023 01:45:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD08E6B0071; Wed, 25 Jan 2023 20:45:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C80A06B0072; Wed, 25 Jan 2023 20:45:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B47E46B0073; Wed, 25 Jan 2023 20:45:40 -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 A08976B0071 for ; Wed, 25 Jan 2023 20:45:40 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 75DFF160972 for ; Thu, 26 Jan 2023 01:45:40 +0000 (UTC) X-FDA: 80395258440.16.E7055DD Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf14.hostedemail.com (Postfix) with ESMTP id 9608C10000D for ; Thu, 26 Jan 2023 01:45:38 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=prmflUUZ; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of yanjun.zhu@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=yanjun.zhu@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674697538; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z4KOttIHpVKCbLr1jUjmRYQ6CJOVPDQyGMQ4zA8kCVw=; b=LYkBWmlFljVZJeE4D+kKaRE0LnYyVmDN8q9grfnemDL3HF3sekJImNDnQjsjlb84/dvEhG L14mbY459tQZ9yF+VfJ3eKrrb+CZURBehk60MxIx4M0s7RFOGX+y0MUPZ//QuvkizRfcqC NbyAM7u8wqDgIWMmqn5Wu37wWF0oI8o= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=prmflUUZ; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of yanjun.zhu@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=yanjun.zhu@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674697538; a=rsa-sha256; cv=none; b=M5k2SjqgJRfOcJjdElnKhh7ccDvlOYGVj3qoDTmz6HHVrNZBTAuNEy2rGKLIKJngTW447y 8eB3iL1RtN1PJbx1+Zgg0fB2LxYiUimI5raQ/G7rxkvHGGLVoe3ONQlUqjsf9K603Dj+h7 V6OUC9+D/3W0d89pHPvOi+HJ6dDnB9I= Message-ID: <56ce760f-188c-3a1d-0512-9122247ea100@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1674697536; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Z4KOttIHpVKCbLr1jUjmRYQ6CJOVPDQyGMQ4zA8kCVw=; b=prmflUUZo/lJoWZPYQY87qo96iE00QkhoR3A/ixwEGMb9JQ6SKYt9nzyVxcTjLGf/yfVjN TbMjehqyfU6FV4JtcWz1tTOthCDG5h9phv4zjocA9eGILYXgFBFlBlNn+Orqc28NlWVdNR YE/ym7jgTyojydoL5rMqJd/l0E9dLmA= Date: Thu, 26 Jan 2023 09:45:21 +0800 MIME-Version: 1.0 Subject: Re: [LSF/MM/BPF proposal]: Physr discussion To: Jason Gunthorpe , lsf-pc@lists.linuxfoundation.org, linux-mm@kvack.org, iommu@lists.linux.dev, linux-rdma@vger.kernel.org Cc: Matthew Wilcox , Christoph Hellwig , Joao Martins , John Hubbard , Logan Gunthorpe , Ming Lei , linux-block@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, nvdimm@lists.linux.dev References: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zhu Yanjun In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9608C10000D X-Stat-Signature: o94jofu4re7gh6zuitgnz8yeajz5ubr4 X-HE-Tag: 1674697538-625970 X-HE-Meta: U2FsdGVkX1+oJ3hw2XCR9V744QiU/omj8+H8j7ip5GqA5xTCv1PHy7AOBYuD6L+nwfH4u6beR1zeoaEOgrc7fcMAgBhWy348fbunyr0kOibwzVcydvaPIw16we8jNOP0U5JQoXz0aXuhnS1zkwQrgQWbMnEl90TFNseXZJEDgnmfo0D9mQO2GinGn6JIQ5P6Zd3L1yq3M/GAn//ylZBvw4uDMZWwU3G/0hIzqFB4d5kTMObsRamPAOW+VQiZUVlBYVZ/tPG5rBQICfwg6zpknQqkYqzB9E5nBbSgTSCjto1DDTSCBSLJa2pCjx+1fPZ/g9BMTz+vMu8fZcERdTl2s9T7IeRmabrhpdu58aqwFrAiolCD+qRFmNK8tEakg42NEXGSkUZoilDMKAszBHEXZMANd3Q1YR+2mWjtrOqs9BDi7xvgbKdRs9jTEFxrdCfhtXwYAB+P+PPjlJPBvMBtcxBeX5wfYLrtkUtwphBfaD8jOlvl+CRQzgVt6est2J9G0MTStL0fZ7FqKORaO6SAEk3PICtMbg5IC3eJQLRbvkrX3NkJSyDcYHFRrwln5hpJxGNBpE0kpxCYx7ZqqAs9lz7TXMaKG+gKdoBfT6ob8I9lf9wY9GomzrVz/Ik1RaL9NED0/XrT3o4bWmIYfP8N1/rQV8WF3uH0LKZFEgFylm8pE9iLvh8pHk35rbGCN3OCkc8OZmW992fE8dwaRe9UUGZG7eSYVyKAAeVEaRETOiSLgGBOzmbxmhmqsUriHTnMHwBkGsNj5lDGiex9Myq/uzZl4KMRBZhDC8hkMsnatECFy+eJEb+7sRFZ7DnABvkWjuEXATrO9zxAuGWE9JPbBw3JRxtRNOdxlmLA9ZtzNfbia96kTqPDy6aozowtNwTvTevi5vMl57cilGmEV3VPqPG6WYO0B5nFCIXTEZ+pCQp6dL+vN1tkI1e9l16ZuKhP27VZ6eCr5Pm5coJv7Xm IvjlYrAf Xfx+0Jhdpq/uUhRVs622kwFCHLsPueIm8spaczTzERPtEF9qu7Z255TLfxsbAaTHrGYei2a26/8yi4LtTjOGdCtnh3SOcLTbVENiwLpV+vZH2UDkURmRt7ejps3FYg/TwkGFVg3Jjxc+itet+LXr6G6Cn/ReUsu3GjJMOj/cqTNr/mok5k+jVblUDHAqOIlX/xSJAKeAUuXimS6KkqESvWfTSG0ZEq1WQxbDIqOQ2EtHQ1N0= 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: 在 2023/1/21 23:03, Jason Gunthorpe 写道: > I would like to have a session at LSF to talk about Matthew's > physr discussion starter: > > https://lore.kernel.org/linux-mm/YdyKWeU0HTv8m7wD@casper.infradead.org/ > > I have become interested in this with some immediacy because of > IOMMUFD and this other discussion with Christoph: > > https://lore.kernel.org/kvm/4-v2-472615b3877e+28f7-vfio_dma_buf_jgg@nvidia.com/ I read through the above patches. I am interested in the dma-buf. Zhu Yanjun > > Which results in, more or less, we have no way to do P2P DMA > operations without struct page - and from the RDMA side solving this > well at the DMA API means advancing at least some part of the physr > idea. > > So - my objective is to enable to DMA API to "DMA map" something that > is not a scatterlist, may or may not contain struct pages, but can > still contain P2P DMA data. From there I would move RDMA MR's to use > this new API, modify DMABUF to export it, complete the above VFIO > series, and finally, use all of this to add back P2P support to VFIO > when working with IOMMUFD by allowing IOMMUFD to obtain a safe > reference to the VFIO memory using DMABUF. From there we'd want to see > pin_user_pages optimized, and that also will need some discussion how > best to structure it. > > I also have several ideas on how something like physr can optimize the > iommu driver ops when working with dma-iommu.c and IOMMUFD. > > I've been working on an implementation and hope to have something > draft to show on the lists in a few weeks. It is pretty clear there > are several interesting decisions to make that I think will benefit > from a live discussion. > > Providing a kernel-wide alternative to scatterlist is something that > has general interest across all the driver subsystems. I've started to > view the general problem rather like xarray where the main focus is to > create the appropriate abstraction and then go about transforming > users to take advatange of the cleaner abstraction. scatterlist > suffers here because it has an incredibly leaky API, a huge number of > (often sketchy driver) users, and has historically been very difficult > to improve. > > The session would quickly go over the current state of whatever the > mailing list discussion evolves into and an open discussion around the > different ideas. > > Thanks, > Jason >