From: Ananth Subject: Fwd: Next vcpu in queue Date: Fri, 24 Apr 2009 09:59:07 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0016361e8960fa061e0468456f0f Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --0016361e8960fa061e0468456f0f Content-Type: multipart/alternative; boundary=0016361e8960fa06170468456f0d --0016361e8960fa06170468456f0d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, In connection with my previous mail, I have attached a file. This file has source code picked up from the book, 'The definitive guide to Xen hypervisor', for adding a simple scheduler to xen. In the functions, rrobin_vcpu_init and rrobin_vcpu_destroy, the book uses (probably a macro call) VCPU_NEXT(struct vcpu). But there is no definition given for that function. It would be great if you can point to an existing function from xen 3.3.1 source code can be used. Also, in the function rrobin_schedule (s_time_t ), the function __get_per_cpu is used (line no. 82) , which is not existing in 3.3.1 code. I want to return an idle task. Could you guide me as to which function in the 3.3.1 source code would be appropriate for the same? Thank you very much. Regards Ananth ---------- Forwarded message ---------- From: Ananth Date: Fri, Apr 24, 2009 at 9:35 AM Subject: Next vcpu in queue To: "xen-devel@lists.xensource.com" Hi, I am using xen 3.3.1 I want to destroy the head element of that list and assign the next in line vcpu as the head. I have declared a pointer struct vcpu * vcpu_list_head. I would like to assign vpu_list_head = ' get the next vcpu in queue which can be scheduled'. I am not sure if there is a already a function available which can do this. Please guide. Thank you --0016361e8960fa06170468456f0d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
In connection with my previous mail, I have attached a file. Thi= s file has source code picked up from the book, 'The definitive guide t= o Xen hypervisor', for adding a simple scheduler to xen.

In the = functions, rrobin_vcpu_init and rrobin_vcpu_destroy, the book uses=A0 (prob= ably a macro call) VCPU_NEXT(struct vcpu). But there is no definition given= for that function. It would be great if you can point to an existing funct= ion from xen 3.3.1 source code can be used.

Also, in the function rrobin_schedule (s_time_t ), the function __get_p= er_cpu is used (line no. 82) , which is not existing in 3.3.1 code.
I wa= nt to return an idle task. Could you guide me as to which function in the 3= .3.1 source code would be appropriate for the same?

Thank you very much.

Regards
Ananth

---------- Forwarded message ----------
From: Ananth <cbananth@gmail.com>
Date: Fri, Apr 24, 2009 at 9:35 AM
Subject: Next vcpu in queue
To: &q= uot;xen-devel@lists.xensou= rce.com" <xen-= devel@lists.xensource.com>


Hi,
I am using xen 3.3.1 I want to destroy the head element of t= hat list and assign the next in line vcpu as the head.
I have declared a= pointer struct vcpu * vcpu_list_head.
I would like to assign vpu_list_h= ead =3D ' get the next vcpu in queue which can be scheduled'. I am = not sure if there is a already a function available which can do this.
Please guide.


Thank you

--0016361e8960fa06170468456f0d-- --0016361e8960fa061e0468456f0f Content-Type: text/plain; charset=US-ASCII; name="sched_rrobin.txt" Content-Disposition: attachment; filename="sched_rrobin.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ftwdlh1k0 CiNpbmNsdWRlIDx4ZW4vY29uZmlnLmg+CiNpbmNsdWRlIDx4ZW4vaW5pdC5oPgojaW5jbHVkZSA8 eGVuL2xpYi5oPgojaW5jbHVkZSA8eGVuL3NjaGVkLmg+CiNpbmNsdWRlIDx4ZW4vZG9tYWluLmg+ CiNpbmNsdWRlIDx4ZW4vZGVsYXkuaD4KI2luY2x1ZGUgPHhlbi9ldmVudC5oPgojaW5jbHVkZSA8 eGVuL3RpbWUuaD4KI2luY2x1ZGUgPHhlbi9wZXJmYy5oPgojaW5jbHVkZSA8eGVuL3NjaGVkLWlm Lmg+CiNpbmNsdWRlIDx4ZW4vc29mdGlycS5oPgojaW5jbHVkZSA8YXNtL2F0b21pYy5oPgojaW5j bHVkZSA8eGVuL2Vycm5vLmg+CgovKiBOZXcgVkNQVXMgd2lsbCBiZSBhcHBlbmRlZCB0byB0aGUg YmVsb3cgbGlua2VkI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ICovCiAgICBkb3sKICAgICAgICAvKiBGaW5kIGEg cnVubmFibGUgQ1BVIGluIHRoZSBsaXN0ICovCiAgICAgICAgaW5jcmVtZW50X3J1bl9xdWV1ZSgp OwoKICAgICAgICBpZih2Y3B1X3J1bm5hYmxlKHZjcHVfbGlzdF9oZWFkKSl7CiAgICAgICAgICAg IHJldC50YXNrID0gdmNwdV9saXN0X2hlYWQ7CiAgICAgICAgfQogICAgfXdoaWxlKGhlYWQgIT0g dmNwdV9saXN0X2hlYWQpOwovKiBJZiBubyBydW5uYWJsZSBWQ1BVIGlzIGZvdW5kLCByZXR1cm4g dGhlIGlkbGUgdGFzayAqLwogICAgcmV0LnRhc2sgPSAoKHN0cnVjdCB2Y3B1KSBfX2dldF9wZXJf Y3B1KHNjaGVkdWxlX2RhdGEpLmlkbGUpOwogICAgcmV0dXJuIHJldDsKCn0Kc3RydWN0IHNjaGVk dWxlciBzY2hlZF9ycm9iaW5fZGVmID0gewogICAgLm5hbWUgICAgICAgICAgID0gIlJvdW5kIHJv YmluIFNjaGVkdWxlciIsCiAgICAub3B0X25hbWUgICAgICAgPSAicnJvYmluIiwKICAgIC5zY2hl ZF9pZCAgICAgICA9IFhFTl9TQ0hFRFVMRVJfUlIsCgogICAgLmluaXRfdmNwdSAgICAgID0gcnJv YmluX3ZjcHVfaW5pdCwKICAgIC5kZXN0cm95X3ZjcHUgICA9IHJyb2Jpbl92Y3B1X2Rlc3Ryb3ks CgogICAgLmRvX3NjaGVkdWxlICAgID0gcnJvYmluX3NjaGVkdWxlLAoKfTs= --0016361e8960fa061e0468456f0f Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --0016361e8960fa061e0468456f0f--