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 X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D92C433E0 for ; Thu, 24 Dec 2020 02:25:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CC3B322571 for ; Thu, 24 Dec 2020 02:25:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC3B322571 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 385668D0065; Wed, 23 Dec 2020 21:25:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30E718D0063; Wed, 23 Dec 2020 21:25:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1FDCC8D0065; Wed, 23 Dec 2020 21:25:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id 0739B8D0063 for ; Wed, 23 Dec 2020 21:25:01 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C044D3634 for ; Thu, 24 Dec 2020 02:25:00 +0000 (UTC) X-FDA: 77626583160.22.cast82_24033c42746d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 9B34718038C3A for ; Thu, 24 Dec 2020 02:25:00 +0000 (UTC) X-HE-Tag: cast82_24033c42746d X-Filterd-Recvd-Size: 4539 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Dec 2020 02:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608776699; 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=JdMJ8HnlG5riluBKSxMPivzDGvzPYrwD7jfW+dFij+4=; b=MssOKCuMveF3r3K5h9JFVQdW7TOg/Ohcb2eNNDPfuzyfx95nCpuzPGeAsYKOiTD4SiVjGD j847a025MBNffLxQ4DaYXMkzHHS/oRsK7QZQXgGeHBA4LPWYYewQ8p5ML8sy/2Vi1mP2vD J9x3IdRZVPInWVNQlUGkBzxd6mGqGVY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-z5fT8538NHm7DeP68XxA3w-1; Wed, 23 Dec 2020 21:24:58 -0500 X-MC-Unique: z5fT8538NHm7DeP68XxA3w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85A081005D4F; Thu, 24 Dec 2020 02:24:55 +0000 (UTC) Received: from [10.72.13.109] (ovpn-13-109.pek2.redhat.com [10.72.13.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4130D60C04; Thu, 24 Dec 2020 02:24:31 +0000 (UTC) Subject: Re: [RFC v2 00/13] Introduce VDUSE - vDPA Device in Userspace To: Yongji Xie Cc: "Michael S. Tsirkin" , Stefan Hajnoczi , sgarzare@redhat.com, Parav Pandit , akpm@linux-foundation.org, Randy Dunlap , Matthew Wilcox , viro@zeniv.linux.org.uk, axboe@kernel.dk, bcrl@kvack.org, corbet@lwn.net, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20201222145221.711-1-xieyongji@bytedance.com> From: Jason Wang Message-ID: <6e81f56a-0f95-248c-e88f-4190ca7f49a2@redhat.com> Date: Thu, 24 Dec 2020 10:24:29 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable 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 2020/12/23 =E4=B8=8B=E5=8D=886:59, Yongji Xie wrote: > On Wed, Dec 23, 2020 at 2:38 PM Jason Wang wrote: >> >> On 2020/12/22 =E4=B8=8B=E5=8D=8810:52, Xie Yongji wrote: >>> This series introduces a framework, which can be used to implement >>> vDPA Devices in a userspace program. The work consist of two parts: >>> control path forwarding and data path offloading. >>> >>> In the control path, the VDUSE driver will make use of message >>> mechnism to forward the config operation from vdpa bus driver >>> to userspace. Userspace can use read()/write() to receive/reply >>> those control messages. >>> >>> In the data path, the core is mapping dma buffer into VDUSE >>> daemon's address space, which can be implemented in different ways >>> depending on the vdpa bus to which the vDPA device is attached. >>> >>> In virtio-vdpa case, we implements a MMU-based on-chip IOMMU driver w= ith >>> bounce-buffering mechanism to achieve that. >> >> Rethink about the bounce buffer stuffs. I wonder instead of using kern= el >> pages with mmap(), how about just use userspace pages like what vhost = did? >> >> It means we need a worker to do bouncing but we don't need to care abo= ut >> annoying stuffs like page reclaiming? >> > Now the I/O bouncing is done in the streaming DMA mapping routines > which can be called from interrupt context. If we put this into a > kworker, that means we need to synchronize with a kworker in an > interrupt context. I think it can't work. We just need to make sure the buffer is ready before the user is trying=20 to access them. But I admit it would be tricky (require shadow virtqueue etc) which is=20 probably not a good idea. Thanks > > Thanks, > Yongji >