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

Re: [Xen-devel] generate random numbers


  • To: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
  • From: "michele.paolino" <michele.paolino@xxxxxxxxxxxxxxx>
  • Date: Fri, 26 Feb 2010 18:43:14 +0100
  • Cc: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 26 Feb 2010 09:44:19 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=j6NZ7DArCIJb8QjOzKC9hVSwxfRVbaI2xQgmxNaNzIRCDqQAH3rWTag8VKN3JVooqA iINJcRxWswhYg2hdcjFpGtdFrHi72Zco0OkDHNLANBw2qudpfPlVRc2B2FEd9l4YtHY9 bFuHSO+B+9V+SvVhZ3KucSuRQdLcqLuQFeoHw=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Following George's advices I have rewrited my scheduler. But now serial console's log report me a bug in a function of timer.c

(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Xen BUG at timer.c:184
(XEN) ****************************************

This is caused by cpumask_raise_softirq() in my wake() function. What can I do?

Michele

On Thu, Feb 25, 2010 at 10:25 PM, George Dunlap <george.dunlap@xxxxxxxxxxxxx> wrote:
The problem is that you're choosing a random vcpu to run, without considering whether it *wants* to run or not.  In this case, you're running a vcpu before it's even been completely set up yet (write_cr3 is failing because the guest *has* no cr3 ready yet).

The normal way schedulers deal with this is to keep one list of all vcpus (or all domains), and another list with "runnable" vcpus.  You can keep track of which vcpus are runnable with the vcpu_wake() callback and by using vcpu_runnable() in schedule().

At very least, your loop in schedule should check vcpu_runnable() before selecting it.

-George


michele.paolino wrote:
Here's my random scheduler. It works until I start a virtual machine (error file attached is the serial console's log).
In xen call trace there isn't any of my functions.
To generate random numbers I'm using the hash (MD5) of NOW() function.
I would also Know why at boot time there are two calls at vcpu_init function for vcpu with id = 0 ??

Thanks
Michele


Attachment: log
Description: Binary data

Attachment: sched_random.c
Description: Text Data

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.