From: Pankaj Parakh Subject: Fwd: How to Stop scheduler Date: Wed, 11 Nov 2009 17:08:53 +0530 Message-ID: <27a8ee1b0911110338s748c894bwdcb69e65a20c4e01@mail.gmail.com> References: <27a8ee1b0911021302n37b76a0bw5259c7b594147abd@mail.gmail.com> <4AF08058.8070801@eu.citrix.com> <27a8ee1b0911032138u4c8d4e00rb574bbff1487241c@mail.gmail.com> <27a8ee1b0911032159q285332d7p883854502bccc28a@mail.gmail.com> <27a8ee1b0911041643g58818b5fsd8b6d166342b54c5@mail.gmail.com> <27a8ee1b0911092248u5d7d99dfuec831063d097ee02@mail.gmail.com> <27a8ee1b0911092305o30ca63faq7073494a37b9472e@mail.gmail.com> <27a8ee1b0911110337k34a03b7di7b7f71ab2e36ffa1@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <27a8ee1b0911110337k34a03b7di7b7f71ab2e36ffa1@mail.gmail.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: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Any answers plzz?? =A0Also is what schedule_lock in schedlue_data is for ?? =A0I tried to use it thinking it'll stop further scheduling, but it hangs =A0my machine and the function doesnot proceed after that.. is something =A0else I have to do to pause scheduling in XEN. > On Tue, Nov 10, 2009 at 12:18 PM, Pankaj Parakh > wrote: =A0How to disable softirq in Xen, if I want that no function should be =A0able to raise SCHEDULE_SOFTIRQ, how can I do that?? =A0> On Thu, Nov 5, 2009 at 3:25 PM, George Dunlap =A0> wrote: =A0>> I assume you mean, once you've paused current(), how do you get into > >> the scheduler to actually get it off the cpu? > >> > >> In Linux, you can call schedule() because each process has its own > >> kernel stack allocated to it; the stack "remembers" where each process > >> was in the kernel, so you can return from schedule() at the same place > >> in the kernel once you're scheduled again. > >> > >> Xen only has one stack per cpu, so it cannot keep track of where *in > >> the hypervisor* a vcpu is that gets scheduled out. =A0Therefore, you > >> can't call schedule() directly, as it would throw away the stack. =A0Y= ou > >> must raise SCHEDULE_SOFTIRQ on the current cpu, and then return back > >> to the guest. =A0On the way out, the softirq will call schedule() and > >> switch to another vcpu if necessary. =A0(It will only schedule the idl= e > >> process if there are no runnable vcpus.) > >> > >> grep for SCHEDULE_SOFTIRQ to see examples of how this is used in Xen. > >> > >> =A0-George > >> > >> On Thu, Nov 5, 2009 at 12:43 AM, Pankaj Parakh > >> wrote: > >>> How can I schedule idle vcpu voluntarily without using schedule() ?? > >>> Is there any function for it already defined, or do I have to follow > >>> some steps.. ?? > >>> > >>> On Wed, Nov 4, 2009 at 5:09 PM, George Dunlap > >>> wrote: > >>>> > >>>> On Wed, Nov 4, 2009 at 5:59 AM, Pankaj Parakh wrote: > >>>> > If I take domain_update_lock for=A0 a domain, what will happen to = its > >>>> > interrupts for IO completions or any other type..?? > >>>> > And will it be scheduled if I hold that lock..?? > >>>> > >>>> Have you looked at the interrupt delivery / IO completion path, or t= he > >>>> scheduler path, to see if those are affected by the > >>>> domain_update_lock()? > >>>> > >>>> Xen is a bit of a twisted web; sometimes you just have to follow a w= eb > >>>> of logic around to find out what you're looking for; then, once you'= ve > >>>> come to a conclusion, test it by writing some code. > >>>> > >>>> For the scheduling question, you might start with looking at vcpu_ru= nnable(). > >>>> > >>>> Peace, > >>>> =A0-George > >>>> > >>>> > > >>>> > On Wed, Nov 4, 2009 at 11:08 AM, Pankaj Parakh > >>>> > wrote: > >>>> >> > >>>> >> So is that means there will be no interrupt loss, and also clock = in > >>>> >> the paused domain will be in right and expected time.. ?? > >>>> >> > >>>> >> On Wed, Nov 4, 2009 at 12:41 AM, George Dunlap > >>>> >> wrote: > >>>> >> > If you call vcpu_pause(), it atomically increments a counter in= the vcpu > >>>> >> > struct. =A0While that counter is non-zero, the vcpu *will not* = be > >>>> >> > scheduled, > >>>> >> > interrupts or no. =A0Interrupts will be delivered when it's sch= eduled > >>>> >> > again. > >>>> >> > > >>>> >> > -George > >>>> >> > > >>>> >> > Pankaj Parakh wrote: > >>>> >> >> > >>>> >> >> =A0If I pause a vcpu/domain using those functions, say if a do= main's I/O > >>>> >> >> request over then its interrupt will raise and it can restart = its > >>>> >> >> scheduling rite..?? How this interrupts are/ can be queued so = that > >>>> >> >> when the vcpu is in pause state, it should nat change its stat= e and > >>>> >> >> when it come back to wait state, those interrupt will not be l= ost.. > >>>> >> >> > >>>> >> >> On Tue, Nov 3, 2009 at 5:18 PM, George Dunlap > >>>> >> >> wrote: > >>>> >> >> > >>>> >> >>> > >>>> >> >>> Do you mean that you want to stop one specific vcpu / domain = from > >>>> >> >>> being scheduled? > >>>> >> >>> > >>>> >> >>> If so, you're looking for the following functions: > >>>> >> >>> vcpu_pause(), vcpu_unpause() > >>>> >> >>> domain_pause(), domain_unpause(). > >>>> >> >>> > >>>> >> >>> They're defined in xen/common/domain.c. > >>>> >> >>> > >>>> >> >>> =A0-George > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> On Mon, Nov 2, 2009 at 9:02 PM, Pankaj Parakh > >>>> >> >>> > >>>> >> >>> wrote: > >>>> >> >>> > >>>> >> >>>> > >>>> >> >>>> Hi All, > >>>> >> >>>> > >>>> >> >>>> I am working on a project wherein I wanted to stop the sched= uling > >>>> >> >>>> activity in hypervisor through 'generic' part of scheduler, = I have > >>>> >> >>>> lil > >>>> >> >>>> confusion as to what all things I need to mask/stop for disa= bling > >>>> >> >>>> hypervisor to schedule any vcpu untill I want. > >>>> >> >>>> > >>>> >> >>>> Issues which I can think are about I/O waits or Zombie VCPUs= . But how > >>>> >> >>>> to tackle them... I dont know.. > >>>> >> >>>> > >>>> >> >>>> I wanted to know what all responsibility the generic schedul= er holds > >>>> >> >>>> in hypervisor, > >>>> >> >>>> > >>>> >> >>>> Any type of info or pointer can be useful. > >>>> >> >>>> > >>>> >> >>>> Thanks > >>>> >> >>>> Pankaj Parakh > >>>> >> >>>> > >>>> >> >>>> _______________________________________________ > >>>> >> >>>> Xen-devel mailing list > >>>> >> >>>> Xen-devel@lists.xensource.com > >>>> >> >>>> http://lists.xensource.com/xen-devel > >>>> >> >>>> > >>>> >> >>>> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> > > >>>> >> > > >>>> >> > >>>> >> > >>>> >> > >>>> >> -- > >>>> >> Pankaj Parakh > >>>> > > >>>> > > >>>> > > >>>> > -- > >>>> > Pankaj Parakh > >>>> > > >>>> > _______________________________________________ > >>>> > Xen-devel mailing list > >>>> > Xen-devel@lists.xensource.com > >>>> > http://lists.xensource.com/xen-devel > >>>> > > >>>> > > >>> > >>> > >>> > >>> -- > >>> Pankaj Parakh > >>> > >>> _______________________________________________ > >>> Xen-devel mailing list > >>> Xen-devel@lists.xensource.com > >>> http://lists.xensource.com/xen-devel > >>> > >> > > > > > > > > -- > > Pankaj Parakh > > > > > > -- > Pankaj Parakh -- Pankaj Parakh --=20 Pankaj Parakh