[Top][All Lists]

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

[Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a V

From: Avi Kivity
Subject: [Qemu-devel] Re: [PATCH] qemu-kvm: response to SIGUSR1 to start/stop a VCPU (v2)
Date: Thu, 02 Dec 2010 15:49:44 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6

On 12/02/2010 03:13 PM, Srivatsa Vaddagiri wrote:
On Thu, Dec 02, 2010 at 02:41:35PM +0200, Avi Kivity wrote:
>  >>   What I'd like to see in directed yield is donating exactly the
>  >>   amount of vruntime that's needed to make the target thread run.
>  >
>  >I presume this requires the target vcpu to move left in rb-tree to run
>  >earlier than scheduled currently and that it doesn't involve any
>  >change to the sched_period() of target vcpu?
>  >
>  >Just was wondering how this would work in case of buggy guests. Lets say 
that a
>  >guest ran into a AB<->BA deadlock. VCPU0 spins on lock B (held by VCPU1
>  >currently), while VCPU spins on lock A (held by VCPU0 currently). Both keep
>  >boosting each other's vruntime, potentially affecting fairtime for other 
>  >(to the point of starving them perhaps)?
>  We preserve vruntime overall.  If you give vruntime to someone, it
>  comes at your own expense.  Overall vruntime is preserved.

Hmm ..so I presume that this means we don't affect target thread's position in
rb-tree upon donation, rather we influence its sched_period() to include
donated time? IOW donation has no effect on causing the target thread to run
"immediately", rather it will have the effect of causing it run "longer"
whenever it runs next?

No. The intent (at least mine, maybe Rik has other ideas) is to move some vruntime from current to target such that target would be placed before current in the timeline.

Even that would require some precaution in directed yield to ensure that it
doesn't unduly inflate vruntime of target, hurting fairness for other guests on
same cpu as target (example guest code that can lead to this situation

vcpu0:                          vcpu1:





directed yield should preserve the invariant that sum(vruntime) does not change.

error compiling committee.c: too many arguments to function

reply via email to

[Prev in Thread] Current Thread [Next in Thread]