From: Jason Wang Subject: Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel virtual address Date: Tue, 12 Mar 2019 15:15:22 +0800 Message-ID: <3b00dc4a-b1b7-aa3f-c4ba-515138e4d6dd@redhat.com> References: <1551856692-3384-1-git-send-email-jasowang@redhat.com> <1551856692-3384-6-git-send-email-jasowang@redhat.com> <20190307103503-mutt-send-email-mst@kernel.org> <20190307124700-mutt-send-email-mst@kernel.org> <20190307191622.GP23850@redhat.com> <20190308194845.GC26923@redhat.com> <8b68a2a0-907a-15f5-a07f-fc5b53d7ea19@redhat.com> <20190311084525-mutt-send-email-mst@kernel.org> <20190311234956-mutt-send-email-mst@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Andrea Arcangeli , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, peterx@redhat.com, linux-mm@kvack.org, Jerome Glisse To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20190311234956-mutt-send-email-mst@kernel.org> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 2019/3/12 上午11:50, Michael S. Tsirkin wrote: >>>> Using direct mapping (I >>>> guess kernel will always try hugepage for that?) should be better and we can >>>> even use it for the data transfer not only for the metadata. >>>> >>>> Thanks >>> We can't really. The big issue is get user pages. Doing that on data >>> path will be slower than copyXuser. >> I meant if we can find a way to avoid doing gup in datapath. E.g vhost >> maintain a range tree and add or remove ranges through MMU notifier. Then in >> datapath, if we find the range, then use direct mapping otherwise >> copy_to_user(). >> >> Thanks > We can try. But I'm not sure there's any reason to think there's any > locality there. > Ok, but what kind of locality do you mean here? Thanks