WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PROPOSAL] Doing work in idle-vcpu context

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PROPOSAL] Doing work in idle-vcpu context
From: Dulloor <dulloor@xxxxxxxxx>
Date: Tue, 20 Apr 2010 02:50:18 -0400
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 19 Apr 2010 23:51:15 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=z3XoaDvSsHLqz0jrbxBtJ8JjS9c9h3nH/oCgMalYYRY=; b=BKs4icksCQ4r3Oux1eY5oix+WgXy1RDceERmyMxRfqP+IzcDMMrvaWe9IAcDG7dDl1 jxjSJ6+kl3bRNj99o18EqyLPfNrMOP852k03K//r2uMtDBT4MNTCeekzTNjzCUFbxuFK wkawiXSqLfwztVB7oCdsy4Me5g1zP+wE/7uzE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mwWtzIQwe4YqxFGuonWM4gOiSJPEBOZkJmbpvyDUyeIwgu/llazwjgEs9pUkIK7IWQ 4VDaldg/3XbQMIFHB/eqyR0eqTaTsvCFizGU+GvByf6SqnGnevwMcsNGOPdF0Wv5VhKU Aa4dH74NpaZk3eU+uRCBRJsP8WNr9kKiBy+x8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C7F1F497.11B73%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C7EE6596.1192F%keir.fraser@xxxxxxxxxxxxx> <C7F1F497.11B73%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, Apr 19, 2010 at 6:52 AM, Keir Fraser <keir.fraser@xxxxxxxxxxxxx> wrote:
> So I've now implemented this at the tip of xen-unstable staging tree. Except
> that I retasked the concept of 'tasklets' to implement this, rather than
> introducing a whole new abstraction like Linux workqueues.
Yeah, this looks better.
>
> Thanks to Dulloor for initial changes to the credit scheduler. I should have
> acknowledged you in the changeset comment too: sorry about that. :-(
No problem :)

>
> George: let me know if the scheduler changes in c/s 21197 look okay.

George might be able to comment better, but two things :
1. Should we not set (ret.time) to some timeslice (rather than -1)
when we BOOST the idle_vcpu (for csched and csched2).
2. Is it fine to use a simple list_empty in checking if the
tasklet_queue is empty for a cpu, with other cpus possibly accessing
the list too.

>
>  Thanks,
>  Keir
>
> On 16/04/2010 19:05, "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx> wrote:
>
>> George, Yunhong, and others,
>>
>> So, it seems that runing stop_machine_run(), and now
>> continue_hypercall_on_cpu(), in softirq context is a bit of a problem.
>> Because the softirq can stop the currently-running vcpu from being
>> descheduled we can end up with subtle deadlocks. For example, with s_m_r()
>> we try to rendezvous all cpus in softirq context -- we can have CPU A enter
>> the softirq interrupting VCPU X, meanwhile VCPU Y on CPU B is spinning
>> trying to pause VCPU X. Hence CPU B doesn't get into softirq, and so CPU A
>> never leaves it, and we have deadlock.
>>
>> There are various possible solutions to this, but one of the architecturally
>> neatest would be to run the s_m_r() and c_h_o_c() work in a
>> 'Linux-workqueue' type of environment -- i.e., in a proper non-guest vcpu
>> context. Rather than introducing the whole kthread concept into Xen, one
>> possibility would be to schedule this work on the idle vcpus -- effectively
>> promoting idle vcpus to a more general kind of 'Xen worker vcpu' whose job
>> can include running the idle loop.
>>
>> One bit of mechanism this would require is the ability to bump the idle vcpu
>> priority up - preferably to 'max' priority forcing it to run next until we
>> return it to idle/lowest priority. George: how hard would such a mechanism
>> be to implement do you think?
>>
>> More generally: what do people think of this idea?
>>
>>  Thanks,
>>  Keir
>>
>
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel