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

Re: [Xen-devel] Vcpu allocation for a newly created domU

To: Sandesh <sandesh.ahiremath@xxxxxxxxx>
Subject: Re: [Xen-devel] Vcpu allocation for a newly created domU
From: "Grzegorz Miłoś" <gm281@xxxxxxxxx>
Date: Fri, 20 Jun 2008 10:41:41 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 20 Jun 2008 02:42:03 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=X2TTi+/estez5wr8Bq5RwE1CdU21mgmsgcZieQAExks=; b=q8EwraTO13aJsH/ysc1ysrM+xLT0SiYIIur66jL1nF55kChREGLz3b8IWg/xnGzg2p /0EV74nNOGxyWkpI7WK+z6iYfQEwY4DcW0/TrwbMTEXTzdMRDVVn70rW/G5rAgYv9uqw F9dPQkNGMbtcoaUcZheEMBARxOnqjggb4JGSc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=fi2ZzbaHUF0YkcCeaRkQFx/Fr80tlwogEIo4I3zJ8EhEXQpShrGP8S0YLecl/SL5aw 5iEkU5S7RMEf99dwr5QEI6HILozZgEOd2DBPx3JUmnrdNbXokRDkVy1Hys0TA/McXHMP kqkG1SaTpEKW8sz+33fEhoNcEcVQ9ppZol84k=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1213951097.4208.33.camel@ec4t16cg-1518809>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1213636037.4215.39.camel@ec4t16cg-1518809> <4cac40570806180413j59d3ca82hcc42d34d62ad1192@xxxxxxxxxxxxxx> <1213790518.4439.72.camel@ec4t16cg-1518809> <4cac40570806180909g3b203d4bifac5fab43f93955c@xxxxxxxxxxxxxx> <1213811921.4439.99.camel@ec4t16cg-1518809> <4cac40570806190730o6bd15111n97a382b27fc558e4@xxxxxxxxxxxxxx> <1213900971.4208.21.camel@ec4t16cg-1518809> <FF8B79E9-8AD3-490C-ADAE-805A6352EDAF@xxxxxxxxx> <1213951097.4208.33.camel@ec4t16cg-1518809>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>> When you enter the scheduler (and also __context_switch) you are
>> running VCPU=current on CPU=smp_processor_id().
>
> this is true only if current is not set to the next vcpu. but if you
> look at context_switch() just before calling __context_switch ,
> set_curent(next) is done. At this point current is actually the next
> vcpu to be scheduled.
>

First of all: I only said that current->proccessor ==
smp_processor_id() will hold on scheduler entry. But this equality is
actually stronger, I believe it will hold always.

>
>>  At this point in time
>> current->processor and smp_processor_id() will match.
>
> So vcpu->processor need not match smp_processor_id()....

Except that the next vcpu (or current, after set_current has been
executed) will also have ->processor filed set to smp_processor_id().
You have to explicitly migrate VCPUs between CPUs (and set their
->processor field in the process) to make them runnable on a different
CPU. For example the credit scheduler does that in
csched_runq_steal(). If it deems a VCPU to be migratable
(__csched_vcpu_is_migrateable) it will remove it from it's current
runqueue (__runq_remove) and update the processor field (vc->processor
= cpu)

Is that clear now?

Gr(z)egor(z)



>
> Thanks,
>  Sandesh
>
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to 
> this message are intended for the exclusive use of the addressee(s) and may 
> contain proprietary, confidential or privileged information. If you are not 
> the intended recipient, you should not disseminate, distribute or copy this 
> e-mail. Please notify the sender immediately and destroy all copies of this 
> message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should 
> check this email and any attachments for the presence of viruses. The company 
> accepts no liability for any damage caused by any virus transmitted by this 
> email.
>
> www.wipro.com
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

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