summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorNadav Har'El <nyh@math.technion.ac.il>2012-02-27 15:07:29 +0200
committerBen Hutchings <ben@decadent.org.uk>2012-07-25 04:11:38 +0100
commit1803c9c9746dd5cd524d6499ca24cbb4eacffa37 (patch)
tree74fc8cbc9175ea304a49dedbc76492dfaf28b1fa /usr
parent51326e07490692aa9049e2952bae36fc5824a63d (diff)
vhost: don't forget to schedule()
commit d550dda192c1bd039afb774b99485e88b70d7cb8 upstream. This is a tiny, but important, patch to vhost. Vhost's worker thread only called schedule() when it had no work to do, and it wanted to go to sleep. But if there's always work to do, e.g., the guest is running a network-intensive program like netperf with small message sizes, schedule() was *never* called. This had several negative implications (on non-preemptive kernels): 1. Passing time was not properly accounted to the "vhost" process (ps and top would wrongly show it using zero CPU time). 2. Sometimes error messages about RCU timeouts would be printed, if the core running the vhost thread didn't schedule() for a very long time. 3. Worst of all, a vhost thread would "hog" the core. If several vhost threads need to share the same core, typically one would get most of the CPU time (and its associated guest most of the performance), while the others hardly get any work done. The trivial solution is to add if (need_resched()) schedule(); After doing every piece of work. This will not do the heavy schedule() all the time, just when the timer interrupt decided a reschedule is warranted (so need_resched returns true). Thanks to Abel Gordon for this patch. Signed-off-by: Nadav Har'El <nyh@il.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions