Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-25 Thread Jason Wang
On 2019/1/25 上午11:03, Michael S. Tsirkin wrote: +/* Suppress the vma that needs writeback since we can not track dirty + * pages now. + */ +static bool vma_can_vmap(struct vm_area_struct *vma) +{ + return vma_is_anonymous(vma) || is_vm_hugetlb_page(vma) || + vma_is_shmem(vma)

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-25 Thread Jason Wang
On 2019/1/25 上午11:03, Michael S. Tsirkin wrote: On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of softwar

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-25 Thread Jason Wang
On 2019/1/25 上午11:00, Michael S. Tsirkin wrote: On Thu, Jan 24, 2019 at 12:07:54PM +0800, Jason Wang wrote: Meanwhile, could you pls post data comparing this last patch with the below? This removes the speculation barrier replacing it with a (useless but at least more lightweight) data depend

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-24 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > It was noticed that the copy_user() friends that was used to access > virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software checks, > speculation barrier, hardware featu

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-24 Thread Michael S. Tsirkin
On Thu, Jan 24, 2019 at 12:07:54PM +0800, Jason Wang wrote: > > Meanwhile, could you pls post data comparing this last patch with the > > below? This removes the speculation barrier replacing it with a > > (useless but at least more lightweight) data dependency. > > > SMAP off > > Your patch: 7

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-24 Thread Jason Wang
On 2019/1/24 下午12:53, Michael S. Tsirkin wrote: - How hard is it to figure out which mode uses which code. It's as simple as tracing __get_user() usage in vhost process? Thanks Well there are now mtu notifiers etc etc. It's hardly as well contained as that. We can setup filter out exactl

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Thu, Jan 24, 2019 at 12:11:28PM +0800, Jason Wang wrote: > > On 2019/1/24 下午12:07, Jason Wang wrote: > > > > On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: > > > On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > > > > It was noticed that the copy_user() friends that was used to ac

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Thu, Jan 24, 2019 at 12:07:54PM +0800, Jason Wang wrote: > > On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: > > On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > > > It was noticed that the copy_user() friends that was used to access > > > virtqueue metdata tends to be very expensi

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
On 2019/1/24 下午12:07, Jason Wang wrote: On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation li

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
On 2019/1/23 下午10:08, Michael S. Tsirkin wrote: On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of softwar

Re: [PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Michael S. Tsirkin
On Wed, Jan 23, 2019 at 05:55:57PM +0800, Jason Wang wrote: > It was noticed that the copy_user() friends that was used to access > virtqueue metdata tends to be very expensive for dataplane > implementation like vhost since it involves lots of software checks, > speculation barrier, hardware featu

[PATCH net-next V4 5/5] vhost: access vq metadata through kernel virtual address

2019-01-23 Thread Jason Wang
It was noticed that the copy_user() friends that was used to access virtqueue metdata tends to be very expensive for dataplane implementation like vhost since it involves lots of software checks, speculation barrier, hardware feature toggling (e.g SMAP). The extra cost will be more obvious when tra