From: MaoXiaoyun Subject: RE: Domain 0 stop response on frequently reboot VMS Date: Sat, 16 Oct 2010 13:39:43 +0800 Message-ID: References: , Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1505881817==" 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: keir@xen.org, xen devel List-Id: xen-devel@lists.xenproject.org --===============1505881817== Content-Type: multipart/alternative; boundary="_db3f4e34-5143-4b32-be3d-22be4ceaea1f_" --_db3f4e34-5143-4b32-be3d-22be4ceaea1f_ Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Well, Thanks Keir. Fortunately we caught the bug, it turned out to be a tapdisk problem.=20 A brief explaination for other guys might confront this issue. =20 Clear BLKTAP_DEFERRED on line 19 will lead to the concurrent access of=20 tap->deferred_queue between line 24 and 37, which will finally cause bad=20 pointer of tap->deferred_queue, and infinte loop in while clause in line = 22. Lock line 24 will be a simple fix.=20 =20 /linux-2.6-pvops.git/drivers/xen/blktap/wait_queue.c 9 void 10 blktap_run_deferred(void) 11 { 12 LIST_HEAD(queue); 13 struct blktap *tap; 14 unsigned long flags; 15 =20 16 spin_lock_irqsave(&deferred_work_lock, flags); 17 list_splice_init(&deferred_work_queue, &queue); 18 list_for_each_entry(tap, &queue, deferred_queue) 19 clear_bit(BLKTAP_DEFERRED, &tap->dev_inuse); 20 spin_unlock_irqrestore(&deferred_work_lock, flags); 21 =20 22 while (!list_empty(&queue)) { 23 tap =3D list_entry(queue.next, struct blktap, deferred_queue)= ; 24 list_del_init(&tap->deferred_queue); 25 blktap_device_restart(tap); 26 } =20 27 } =20 28=20 29 void 30 blktap_defer(struct blktap *tap) 31 { 32 unsigned long flags; 33 =20 34 spin_lock_irqsave(&deferred_work_lock, flags); 35 if (!test_bit(BLKTAP_DEFERRED, &tap->dev_inuse)) { 36 set_bit(BLKTAP_DEFERRED, &tap->dev_inuse); 37 list_add_tail(&tap->deferred_queue, &deferred_work_queue); 38 } =20 39 spin_unlock_irqrestore(&deferred_work_lock, flags); 40 }=20 =20 > Date: Fri, 15 Oct 2010 13:57:09 +0100 > Subject: Re: [Xen-devel] Domain 0 stop response on frequently reboot VM= S > From: keir@xen.org > To: tinnycloud@hotmail.com; xen-devel@lists.xensource.com >=20 > You'll probably want to see if you can get SysRq output from dom0 via s= erial > line. It's likely you can if it is alive enough to respond to ping. Thi= s > might tell you things like what all processes are getting blocked on, a= nd > thus indicate what is stopping dom0 from making progress. >=20 > -- Keir >=20 > On 15/10/2010 13:43, "MaoXiaoyun" wrote: >=20 > >=20 > > Hi Keir: > >=20 > > First, I'd like to express my appreciation for the help your offered > > before. > > Well, recently we confront a rather nasty domain 0 no response > > problem. > >=20 > > We still have 12 HVMs almost continuously and concurrently reboot > > test on a physical server. > > A few hours later, the server looks like dead. We only can ping to > > the server and get right response, > > the Xen works fine since we can get debug info from serial port. Atta= ched is > > the full debug output. > > After decode the domain 0 CPU stack, I find the CPU still works for d= omain 0 > > since the stack changed > > info changed every time I dumped. > >=20 > > Could help to take a look at the attentchment to see whether there ar= e > > some hints for debugging this > > problem. Thanks in advance. > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > >=20 > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel >=20 >=20 =20 --_db3f4e34-5143-4b32-be3d-22be4ceaea1f_ Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable Well, Thanks Keir.
Fortunately we caught the bug, it turned out to be a tapdisk&nb= sp;problem.
A brief explaination for other guys might confront this issue.
 
Clear  BLKTAP_DEFERRED on line 19 will lead to the concurrent access= of
tap->deferred_queue between line 24 and 37, which will finally cause b= ad
pointer of tap->deferred_queue, and infinte loop in while clause in li= ne 22.
Lock line 24 will be a simple fix.
 
/linux-2.6-pvops.git/drivers/xen/blktap/wait_queue.c
  9 void
 10 blktap_run_deferred(void)
 11 {
&nbs= p;12     LIST_HEAD(queue);
 13  &nb= sp;  struct blktap *tap;
 14     unsigne= d long flags;
 15    
 16  = ;   spin_lock_irqsave(&deferred_work_lock, flags);
 = ;17     list_splice_init(&deferred_work_queue, &a= mp;queue);
 18     list_for_each_entry(tap, &= amp;queue, deferred_queue)
 19      = ;   clear_bit(BLKTAP_DEFERRED, &tap->dev_inuse);
&nbs= p;20     spin_unlock_irqrestore(&deferred_work_lo= ck, flags);
 21    
 22  &= nbsp;  while (!list_empty(&queue)) {
 23  &nbs= p;      tap =3D list_entry(queue.next, struct bl= ktap, deferred_queue);
 24 &nb sp;       list_del_init(&tap->defer= red_queue);
 25         b= lktap_device_restart(tap);
 26     } &nb= sp;
 27 }  
 28
 29 void
 30= blktap_defer(struct blktap *tap)
 31 {
 32  &n= bsp;  unsigned long flags;
 33    
&= nbsp;34     spin_lock_irqsave(&deferred_work_lock= , flags);
 35     if (!test_bit(BLKTAP_DEFERR= ED, &tap->dev_inuse)) {
 36     &= nbsp;   set_bit(BLKTAP_DEFERRED, &tap->dev_inuse);
&n= bsp;37         list_add_tail(&= ;tap->deferred_queue, &deferred_work_queue);
 38 &nbs= p;   }  
 39     spin_un= lock_irqrestore(&deferred_work_lock, f lags);
 40 }

 
> Date: Fri, 15 Oct 2010 13:57:09 +0100
> Subject: Re: [Xen-deve= l] Domain 0 stop response on frequently reboot VMS
> From: keir@xen= .org
> To: tinnycloud@hotmail.com; xen-devel@lists.xensource.com>
> You'll probably want to see if you can get SysRq output fr= om dom0 via serial
> line. It's likely you can if it is alive enoug= h to respond to ping. This
> might tell you things like what all pr= ocesses are getting blocked on, and
> thus indicate what is stoppin= g dom0 from making progress.
>
> -- Keir
>
> On= 15/10/2010 13:43, "MaoXiaoyun" <tinnycloud@hotmail.com> wrote:
= >
> >
> > Hi Keir:
> >
> > Firs= t, I'd like to express my appreciation for the help your offered
> = > before.
> > Well, recently we confront a rather nasty domai= n 0 no response
> > problem.
> >
> > We still= have 12 HVMs almost continuously and con currently reboot
> > test on a physical server.
> > A = few hours later, the server looks like dead. We only can ping to
> = > the server and get right response,
> > the Xen works fine s= ince we can get debug info from serial port. Attached is
> > the= full debug output.
> > After decode the domain 0 CPU stack, I f= ind the CPU still works for domain 0
> > since the stack changed=
> > info changed every time I dumped.
> >
> >= ; Could help to take a look at the attentchment to see whether there are<= BR>> > some hints for debugging this
> > problem. Thanks i= n advance.
> >
> >
> >
> >
>= ; >
> >
> >
> > ________________________= _______________________
> > Xen-devel mailing list
> > = Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen= -devel
>
>
--_db3f4e34-5143-4b32-be3d-22be4ceaea1f_-- --===============1505881817== 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 --===============1505881817==--