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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 A4DE5C433DB for ; Wed, 23 Dec 2020 10:59:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1418422240 for ; Wed, 23 Dec 2020 10:59:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1418422240 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 802758D0022; Wed, 23 Dec 2020 05:59:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B1628D0023; Wed, 23 Dec 2020 05:59:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 692F98D0022; Wed, 23 Dec 2020 05:59:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 53FB78D0001 for ; Wed, 23 Dec 2020 05:59:54 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1EA912479 for ; Wed, 23 Dec 2020 10:59:54 +0000 (UTC) X-FDA: 77624251908.26.toad84_400c9ab27468 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id E48601804B670 for ; Wed, 23 Dec 2020 10:59:53 +0000 (UTC) X-HE-Tag: toad84_400c9ab27468 X-Filterd-Recvd-Size: 4628 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Dec 2020 10:59:53 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id c7so15808314edv.6 for ; Wed, 23 Dec 2020 02:59:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EJYssnIVO9+6+TEhutNIY19jP+0vyYszSOhuqVf4GPs=; b=h3NR7oNJIn5F3wRuwjTuh1CxonfEpyDcUAjhDF8YqjPoKP68o7yGLicZas6bNXZLwI mNwBwrPDtQho+r2o+MCdF/Hi4zNNnThaC0HyMSSdb75eteDBB2eS+bpUANrPGv8Jkjbe uDt/0UzQ42zq/mEWOa30tpD8U/ZafqJbezlF0aW4uB4JicN7DA+lYQppmb/HvQDQSAs4 SrTu/o2DlHYvfmspF48uYG6PVAUtGcyNbBJJSh/SbRnhHDEYIrGVFAg0XzIX9owTt730 lxtkqqK3Id2P4VS7pYhEvy/kzQRfCSu1FRyeOdfoMP+7Z1yUZehTGO2Kpr/yFGYI67wz kbgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EJYssnIVO9+6+TEhutNIY19jP+0vyYszSOhuqVf4GPs=; b=NzlKaFnGJmcYAwN64vySBh2tUOWKrCG+UmAbWQW3uSZ4RGsNb3Og9BDJlg30M9+v43 oU28g9p6CARiRoa+9tsyNVJTRtO5DICkCxmafo0czJSrk6QFSHwYRFfIh9YU5rfam6Eq +ULMnS0re/tQu92LMS7TtCVE8EykKSy7fP7a4pJiAwwXMUS+K3GyLzfz2Q0cHNQFCVvx gwo15xK4iGTrm6EIg+o1n6gKVOnoJMbyJ83WDkxVEDuA6HDd7024ylV8sDDCpVLhOjFp ni4qNbk59iZn1YTUzqGxDPaGcL+OJ8rnG2m1/LxviW/vWuicRoJ6xhzTAQ9pAHwBq+FE 7WpQ== X-Gm-Message-State: AOAM531e8f2UwALUgmLFrc1jn9RPd5Or/CKG8UAyWA3N+Tw6nDL24oOZ fixwnJVrv/J+ML+8am7kATIzCKxiunFRclTs3mOF X-Google-Smtp-Source: ABdhPJx3rYPUtrISFW4ljkWLabhg1Bc8Nd7OaYANMSQqXeNKfHuAJ4ghonPQ7GPKFsoidfowCFGFzBOXvuD4xF3IT3g= X-Received: by 2002:a50:f304:: with SMTP id p4mr23478658edm.118.1608721192052; Wed, 23 Dec 2020 02:59:52 -0800 (PST) MIME-Version: 1.0 References: <20201222145221.711-1-xieyongji@bytedance.com> In-Reply-To: From: Yongji Xie Date: Wed, 23 Dec 2020 18:59:41 +0800 Message-ID: Subject: Re: [RFC v2 00/13] Introduce VDUSE - vDPA Device in Userspace To: Jason Wang 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 Content-Type: text/plain; charset="UTF-8" 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 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 wit= h > > bounce-buffering mechanism to achieve that. > > > Rethink about the bounce buffer stuffs. I wonder instead of using kernel > 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 about > 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. Thanks, Yongji