From: George Dunlap <george.dunlap@eu.citrix.com>
To: "michele.paolino" <michele.paolino@studio.unibo.it>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>
Subject: Re: generate random numbers
Date: Thu, 25 Feb 2010 21:25:48 +0000 [thread overview]
Message-ID: <4B86EADC.70301@eu.citrix.com> (raw)
In-Reply-To: <14f366f91002251031g538dcffan9fe5208b5d981444@mail.gmail.com>
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
next prev parent reply other threads:[~2010-02-25 21:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-11 20:31 generate random numbers michele.paolino
2010-02-12 1:51 ` James Harper
2010-02-12 8:32 ` michele.paolino
2010-02-12 12:15 ` George Dunlap
2010-02-12 22:42 ` michele.paolino
2010-02-12 23:12 ` Daniel Stodden
2010-02-25 18:31 ` michele.paolino
2010-02-25 21:25 ` George Dunlap [this message]
2010-02-26 17:43 ` michele.paolino
2010-02-26 17:44 ` George Dunlap
2010-02-26 18:54 ` michele.paolino
2010-03-01 11:41 ` George Dunlap
2010-03-01 16:56 ` michele.paolino
2010-03-02 12:58 ` George Dunlap
2010-03-03 7:52 ` michele.paolino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B86EADC.70301@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=Xen-devel@lists.xensource.com \
--cc=michele.paolino@studio.unibo.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).