Re: [PATCH] vhost: don't forget to schedule()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 04, 2012 at 11:10:01AM +0200, Nadav Har'El wrote:
> On Tue, Feb 28, 2012, Avi Kivity wrote about "Re: [PATCH] vhost: don't forget to schedule()":
> > > > > +			if (need_resched())
> > > > > +				schedule();
> > > > This is cond_resched(), no?
> > >
> > > It indeed looks similar, but it appears there are some slightly
> > > different things happening in both cases, especially for a preemptive
> >...
> > I'd have expected that cond_resched() is a no-op with preemptible
> > kernels, but I see this is not the case.
> 
> Hi. This discussion is already getting several orders of magnitude longer
> than the patch :-)
> 
> Would you like me to send a new one-line patch calling "cond_resched()"
> instead of need_resched/schedule? Or anything else that I can do?

The argument is mostly about what's faster, right?
You can push the argument along if you run some benchmarks to show the
performance impact of the proposed variants.

Measure bandwidth (using e.g. netperf) divided by host CPU utilization
(note: netperf reports guest utilization, that is mostly not
interesting, use something like mpstat to measure on host),
and compare between baseline, your patch, cond_resched, whatever else
you come up with.

> > > But I now see that in kvm_main.c, there's also this:
> > >
> > >         if (!need_resched())
> > >                 return;
> > >         cond_resched();
> >...
> > 
> > It's bogus.  Look at commit 3fca03653010:
> >...
> > +       if (!need_resched())
> > +               return;
> >         vcpu_put(vcpu);
> >         cond_resched();
> >         vcpu_load(vcpu);
> > 
> > at that time, it made sense to do the extra check to avoid the expensive
> > vcpu_put/vcpu_load.  Later preempt notifiers made them redundant
> > (15ad71460d75), and they were removed, but the extra check remained.
> 
> Do you want a patch to remove this extra check? Or you can just remove
> it yourself?
> 
> Thanks,
> Nadav.
> 
> -- 
> Nadav Har'El                        |                     Sunday, Mar 4 2012, 
> nyh@xxxxxxxxxxxxxxxxxxx             |-----------------------------------------
> Phone +972-523-790466, ICQ 13349191 |As every cat owner knows, nobody owns a
> http://nadav.harel.org.il           |cat.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux