netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch
@ 2017-08-19  6:41 Koichiro Den
  2017-08-21  3:09 ` Jason Wang
  2017-08-21 19:45 ` Michael S. Tsirkin
  0 siblings, 2 replies; 4+ messages in thread
From: Koichiro Den @ 2017-08-19  6:41 UTC (permalink / raw)
  To: mst, jasowang; +Cc: netdev, kvm, virtualization

Signed-off-by: Koichiro Den <den@klaipeden.com>
---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index e4613a3c362d..93e909afc1c3 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1184,7 +1184,7 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq,
 	while (len > s) {
 		node = vhost_umem_interval_tree_iter_first(&umem->umem_tree,
 							   addr,
-							   addr + len - 1);
+							   addr + len - s - 1);
 		if (node == NULL || node->start > addr) {
 			vhost_iotlb_miss(vq, addr, access);
 			return false;
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch
  2017-08-19  6:41 [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch Koichiro Den
@ 2017-08-21  3:09 ` Jason Wang
  2017-08-21 19:45 ` Michael S. Tsirkin
  1 sibling, 0 replies; 4+ messages in thread
From: Jason Wang @ 2017-08-21  3:09 UTC (permalink / raw)
  To: Koichiro Den, mst; +Cc: kvm, virtualization, netdev



On 2017年08月19日 14:41, Koichiro Den wrote:
> Signed-off-by: Koichiro Den <den@klaipeden.com>
> ---
>   drivers/vhost/vhost.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index e4613a3c362d..93e909afc1c3 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1184,7 +1184,7 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq,
>   	while (len > s) {
>   		node = vhost_umem_interval_tree_iter_first(&umem->umem_tree,
>   							   addr,
> -							   addr + len - 1);
> +							   addr + len - s - 1);
>   		if (node == NULL || node->start > addr) {
>   			vhost_iotlb_miss(vq, addr, access);
>   			return false;

Acked-by: Jason Wang <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch
  2017-08-19  6:41 [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch Koichiro Den
  2017-08-21  3:09 ` Jason Wang
@ 2017-08-21 19:45 ` Michael S. Tsirkin
  2017-08-22 14:09   ` Koichiro Den
  1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2017-08-21 19:45 UTC (permalink / raw)
  To: Koichiro Den; +Cc: jasowang, kvm, virtualization, netdev

On Sat, Aug 19, 2017 at 03:41:14PM +0900, Koichiro Den wrote:
> Signed-off-by: Koichiro Den <den@klaipeden.com>
> ---
>  drivers/vhost/vhost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index e4613a3c362d..93e909afc1c3 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1184,7 +1184,7 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq,
>  	while (len > s) {
>  		node = vhost_umem_interval_tree_iter_first(&umem->umem_tree,
>  							   addr,
> -							   addr + len - 1);
> +							   addr + len - s - 1);
>  		if (node == NULL || node->start > addr) {
>  			vhost_iotlb_miss(vq, addr, access);
>  			return false;

This works but it probably makes sense to just refactor the code to make end of
range a variable. I posted a patch like this, pls take a look.

> -- 
> 2.9.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch
  2017-08-21 19:45 ` Michael S. Tsirkin
@ 2017-08-22 14:09   ` Koichiro Den
  0 siblings, 0 replies; 4+ messages in thread
From: Koichiro Den @ 2017-08-22 14:09 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: netdev, kvm, virtualization

On Mon, 2017-08-21 at 22:45 +0300, Michael S. Tsirkin wrote:
> On Sat, Aug 19, 2017 at 03:41:14PM +0900, Koichiro Den wrote:
> > Signed-off-by: Koichiro Den <den@klaipeden.com>
> > ---
> >  drivers/vhost/vhost.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> > index e4613a3c362d..93e909afc1c3 100644
> > --- a/drivers/vhost/vhost.c
> > +++ b/drivers/vhost/vhost.c
> > @@ -1184,7 +1184,7 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq,
> >  	while (len > s) {
> >  		node = vhost_umem_interval_tree_iter_first(&umem-
> > >umem_tree,
> >  							   addr,
> > -							   addr + len - 1);
> > +							   addr + len - s -
> > 1);
> >  		if (node == NULL || node->start > addr) {
> >  			vhost_iotlb_miss(vq, addr, access);
> >  			return false;
> 
> This works but it probably makes sense to just refactor the code to make end
> of
> range a variable. I posted a patch like this, pls take a look.
> 
> > -- 
> > 2.9.4
> > 
Ok, thanks.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-22 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-19  6:41 [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch Koichiro Den
2017-08-21  3:09 ` Jason Wang
2017-08-21 19:45 ` Michael S. Tsirkin
2017-08-22 14:09   ` Koichiro Den

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).