From mboxrd@z Thu Jan 1 00:00:00 1970 From: "michele.paolino" Subject: Re: generate random numbers Date: Mon, 1 Mar 2010 17:56:46 +0100 Message-ID: <14f366f91003010856w71bc8b1djba1375f74989d437@mail.gmail.com> References: <14f366f91002111231reae2e41vc8f823b38e16a76b@mail.gmail.com> <14f366f91002121442h536a2d03if7d9bdee416a4a23@mail.gmail.com> <1266016370.15135.2942.camel@agari.van.xensource.com> <14f366f91002251031g538dcffan9fe5208b5d981444@mail.gmail.com> <4B86EADC.70301@eu.citrix.com> <14f366f91002260943n203faba8r79b3c0d4d5d7622d@mail.gmail.com> <4B880897.6080205@eu.citrix.com> <14f366f91002261054r593aa3d1wc3de3fa7fbc1257d@mail.gmail.com> <4B8BA7E3.50700@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1452180771==" Return-path: In-Reply-To: <4B8BA7E3.50700@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============1452180771== Content-Type: multipart/alternative; boundary=001517588ca499f0340480c023c7 --001517588ca499f0340480c023c7 Content-Type: text/plain; charset=ISO-8859-1 I'm really sorry, maybe I misunderstood your mail. I don't want anyone to work for me.:-) I looked at the functions listed in Xen call trace...I think my problem is the timer variable called periodic_timer of struct vcpu. In function remove_entry() there is a switch/case construct that check if vcpu->periodic_timer->status is initialized at TIMER_STATUS_in_heap or TIMER_STATUS_in_list. Which one should I use? Should Initialize it at one of timer status defined in timer.h file? Thanks, Michele On Mon, Mar 1, 2010 at 12:41 PM, George Dunlap wrote: > If you want us to spend some of our time helping you, you need to > demonstrate that you've tried to spend some time helping yourself. How > might rc come to be 0 at that line? What is remove_entry() doing? How > could this have come about because of something your code did? > > An example mail that would get more help would be something like this: > > "I've looked at the remove_entry() function, and it seems that the bug can > be triggered if the input is {some condition}. I looked at where > remove_entry() is being called, but I can't figure out how it can get that > condition because of my code." > > -George > > michele.paolino wrote: > >> Line 184 correspond at rc = 0 (an int variable) of remove_entry() >> function. I don't have modified that file. >> >> Michele >> >> >> On Fri, Feb 26, 2010 at 6:44 PM, George Dunlap < >> george.dunlap@eu.citrix.com > wrote: >> >> Did you look at timer.c, line 184, to find out what the BUG is? >> -George >> >> michele.paolino wrote: >> >> 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 >> > >> > >> 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 >> >> >> >> >> >> > --001517588ca499f0340480c023c7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm really sorry, maybe I misunderstood your mail. =A0I don't want = anyone to work for me.:-)
I looked at the functions listed in Xen call trace...I think my problem is the timer variable called periodic_timer of struct vcpu.
In function remove_entry() there is a switch/case construct that check if vcpu->periodic_timer->status is initialized at TIMER_STATUS_in_heap or TIMER_STATUS_in_list. Which one should I use?
Should Initialize it at one of timer status defined in timer.h file?
Thanks,
Michele


On Mon, Mar 1, = 2010 at 12:41 PM, George Dunlap <george.dunlap@eu.citrix.com= > wrote:
If you want us to= spend some of our time helping you, you need to demonstrate that you'v= e tried to spend some time helping yourself. =A0How might rc come to be 0 a= t that line? =A0What is remove_entry() doing? =A0How could this have come a= bout because of something your code did?

An example mail that would get more help would be something like this:

"I've looked at the remove_entry() function, and it seems that the= bug can be triggered if the input is {some condition}. =A0I looked at wher= e remove_entry() is being called, but I can't figure out how it can get= that condition because of my code."

-George

michele.paolino wrote:
Line 184 correspond at rc =3D 0 (an int variable) of remove_entry() functio= n. I don't have modified that file.

Michele


On Fri, Feb 26, 2010 at 6:44 PM, George Dunlap <george.dunlap@eu.citrix.com &l= t;mailto:g= eorge.dunlap@eu.citrix.com>> wrote:

=A0 =A0Did you look at timer.c, line 184, to find out what the BUG is?
=A0 =A0-George

=A0 =A0michele.paolino wrote:

=A0 =A0 =A0 =A0Following George's advices I have rewrited my scheduler= . But
=A0 =A0 =A0 =A0now serial console's log report me a bug in a function = of timer.c

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

=A0 =A0 =A0 =A0This is caused by cpumask_raise_softirq() in my wake()
=A0 =A0 =A0 =A0function. What can I do?

=A0 =A0 =A0 =A0Michele

=A0 =A0 =A0 =A0On Thu, Feb 25, 2010 at 10:25 PM, George Dunlap
=A0 =A0 =A0 =A0<george.dunlap@eu.citrix.com
=A0 =A0 =A0 =A0<mailto:george.dunlap@eu.citrix.com>
=A0 =A0 =A0 =A0<mailto:george.dunlap@eu.citrix.com
=A0 =A0 =A0 =A0<mailto:george.dunlap@eu.citrix.com>>> wrote:

=A0 =A0 =A0 =A0 =A0 The problem is that you're choosing a random vcpu = to run,
=A0 =A0 =A0 =A0without
=A0 =A0 =A0 =A0 =A0 considering whether it *wants* to run or not. =A0In th= is case,
=A0 =A0 =A0 =A0 =A0 you're running a vcpu before it's even been co= mpletely set
=A0 =A0 =A0 =A0up yet
=A0 =A0 =A0 =A0 =A0 (write_cr3 is failing because the guest *has* no cr3 r= eady
=A0 =A0 =A0 =A0yet).

=A0 =A0 =A0 =A0 =A0 The normal way schedulers deal with this is to keep on= e list of
=A0 =A0 =A0 =A0 =A0 all vcpus (or all domains), and another list with &quo= t;runnable"
=A0 =A0 =A0 =A0 =A0 vcpus. =A0You can keep track of which vcpus are runnab= le with the
=A0 =A0 =A0 =A0 =A0 vcpu_wake() callback and by using vcpu_runnable() in =A0 =A0 =A0 =A0schedule().

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

=A0 =A0 =A0 =A0 =A0 -George


=A0 =A0 =A0 =A0 =A0 michele.paolino wrote:

=A0 =A0 =A0 =A0 =A0 =A0 =A0 Here's my random scheduler. It works until= I start a
=A0 =A0 =A0 =A0virtual
=A0 =A0 =A0 =A0 =A0 =A0 =A0 machine (error file attached is the serial con= sole's log).
=A0 =A0 =A0 =A0 =A0 =A0 =A0 In xen call trace there isn't any of my fu= nctions.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 To generate random numbers I'm using the h= ash (MD5) of
=A0 =A0 =A0 =A0NOW()
=A0 =A0 =A0 =A0 =A0 =A0 =A0 function.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 I would also Know why at boot time there are t= wo calls at
=A0 =A0 =A0 =A0 =A0 =A0 =A0 vcpu_init function for vcpu with id =3D 0 ??
=A0 =A0 =A0 =A0 =A0 =A0 =A0 Thanks
=A0 =A0 =A0 =A0 =A0 =A0 =A0 Michele







--001517588ca499f0340480c023c7-- --===============1452180771== 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 --===============1452180771==--