xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: MaoXiaoyun <tinnycloud@hotmail.com>
Cc: xen devel <xen-devel@lists.xensource.com>
Subject: Re: VM hung after running sometime
Date: Mon, 20 Sep 2010 10:35:46 +0100	[thread overview]
Message-ID: <C8BCE982.23833%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <BAY121-W55A5D5C31D990DE652359DA7E0@phx.gbl>

On 20/09/2010 10:15, "MaoXiaoyun" <tinnycloud@hotmail.com> wrote:

> Thanks Keir.
>  
> You're right, after I deeply looked into the wait_on_xen_event_channel, it is
> smart enough
> to avoid the race I assumed.
>  
> How about prepare_wait_on_xen_event_channel ?
> Currently Istill don't know when it will be invoked.
> Could enlighten me?

As you can see it is called from hvm_send_assist_req(), hence it is called
whenever an ioreq is sent to qemu-dm. Note that it is called *before*
qemu-dm is notified -- hence it cannot race the wakeup from qemu, as we will
not get woken until qemu-dm has done the work, and it cannot start the work
until it is notified, and it is not notified until after
prepare_wait_on_xen_event_channel has been executed.

 -- Keir

>  
>> Date: Mon, 20 Sep 2010 08:45:21 +0100
>> Subject: Re: VM hung after running sometime
>> From: keir.fraser@eu.citrix.com
>> To: tinnycloud@hotmail.com
>> CC: xen-devel@lists.xensource.com; jbeulich@novell.com
>> 
>> On 20/09/2010 07:00, "MaoXiaoyun" <tinnycloud@hotmail.com> wrote:
>> 
>>> When IO is not ready, domain U in VMEXIT->hvm_do_resume might invoke
>>> wait_on_xen_event_channel
>>> (where it is blocked in _VPF_blocked_in_xen).
>>> 
>>> Here is my assumption of event missed.
>>> 
>>> step 1: hvm_do_resume execute 260, and suppose p->state is STATE_IOREQ_READY
>>> or STATE_IOREQ_INPROCESS
>>> step 2: then in cpu_handle_ioreq is in line 547, it execute line 548 so
>>> quickly before hvm_do_resume execute line 270.
>>> Well, the event is missed.
>>> In other words, the _VPF_blocked_in_xen is cleared before it is actually
>>> setted, and Domian U who is blocked
>>> might never get unblocked, it this possible?
>> 
>> Firstly, that code is very paranoid and it should never actually be the case
>> that we see STATE_IOREQ_READY or STATE_IOREQ_INPROCESS in hvm_do_resume().
>> Secondly, even if you do, take a look at the implementation of
>> wait_on_xen_event_channel() -- it is smart enough to avoid the race you
>> mention.
>> 
>> -- Keir
>> 
>> 
>        

  reply	other threads:[~2010-09-20  9:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BAY121-W45A47AC73BDA1A9E7474A2DA720@phx.gbl>
     [not found] ` <C8ACD97B.1256D%keir.fraser@eu.citrix.com>
2010-09-10 11:01   ` VM hung after running sometime MaoXiaoyun
2010-09-19 10:37     ` MaoXiaoyun
2010-09-19 11:49       ` Keir Fraser
2010-09-19 12:21         ` Zhang, Yang Z
2010-09-20  6:00         ` MaoXiaoyun
2010-09-20  7:45           ` Keir Fraser
2010-09-20  8:23             ` MaoXiaoyun
2010-09-20  9:15             ` MaoXiaoyun
2010-09-20  9:35               ` Keir Fraser [this message]
2010-09-21  5:02                 ` MaoXiaoyun
2010-09-21  7:53                   ` Keir Fraser
2010-09-21  9:24                     ` wei song
2010-09-21  9:49                       ` wei song
2010-09-21 17:28                     ` Jeremy Fitzhardinge
2010-09-22  0:02                       ` MaoXiaoyun
2010-09-22  0:17                         ` Jeremy Fitzhardinge
2010-09-22  1:19                           ` MaoXiaoyun
2010-09-22 18:31                             ` Jeremy Fitzhardinge
2010-09-23  0:55                               ` MaoXiaoyun
2010-09-23 23:20                                 ` Jeremy Fitzhardinge
2010-09-24  4:29                                   ` MaoXiaoyun
2010-09-25  9:33                                   ` MaoXiaoyun
2010-09-25 10:40                                     ` wei song
2010-09-27 18:02                                       ` Jeremy Fitzhardinge
2010-09-27 11:56                                     ` MaoXiaoyun
2010-09-28  5:43                                   ` MaoXiaoyun
2010-09-28 11:23                                     ` MaoXiaoyun
2010-09-28 17:07                                       ` Jeremy Fitzhardinge
2010-09-29  6:01                                         ` MaoXiaoyun
2010-09-29 16:12                                           ` Jeremy Fitzhardinge
2010-10-15 12:43     ` Domain 0 stop response on frequently reboot VMS MaoXiaoyun
2010-10-15 12:57       ` Keir Fraser
2010-10-16  5:39         ` MaoXiaoyun
2010-10-16  7:16           ` Keir Fraser
2010-10-18 21:17           ` Daniel Stodden
2010-10-24  5:48             ` MaoXiaoyun
2010-10-24  5:56               ` Daniel Stodden
2010-10-26  8:16                 ` MaoXiaoyun
2010-10-26  9:09                   ` Daniel Stodden
2010-10-26 10:54                     ` MaoXiaoyun
2010-10-26  9:20                   ` Ian Campbell
2010-10-26 10:59                     ` MaoXiaoyun
2010-10-26 11:54                       ` Domain 0 stop response on frequently reboot VMS, fix xen/master link? Pasi Kärkkäinen
2010-10-26 17:08                         ` Jeremy Fitzhardinge
2010-11-04  3:09               ` A Patch for modify DomU network transmit rate dynamically MaoXiaoyun
2010-11-04  3:43                 ` MaoXiaoyun

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=C8BCE982.23833%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=tinnycloud@hotmail.com \
    --cc=xen-devel@lists.xensource.com \
    /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).