* why xenstore-* hangs if xenstored is not started
@ 2010-06-22 7:32 Yu Zhiguo
2010-06-22 7:44 ` Vincent Hanquez
2010-06-22 7:45 ` Keir Fraser
0 siblings, 2 replies; 10+ messages in thread
From: Yu Zhiguo @ 2010-06-22 7:32 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
Running xenstore-* when xenstored is not started, it will hang and
cannot accept any signal, e.g. SIGINT.
I seems that the process is blocked at accessing '/proc/xen/xenbus'.
# mount -t xenfs xenfs /proc/xen/
# xenstore-ls
call trace:
do_ls() -> xs_directory() -> xs_talkv() -> xs_write_all() -> write()
BLOCK is no problem but why process cannot accept signal, Any opinion?
If start xenstored in other console, xenstore-ls executes and then
receive the signal, seems the signal is pended...
--
Regards
Yu Zhiguo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:32 why xenstore-* hangs if xenstored is not started Yu Zhiguo
@ 2010-06-22 7:44 ` Vincent Hanquez
2010-06-22 7:58 ` Yu Zhiguo
2010-06-22 7:45 ` Keir Fraser
1 sibling, 1 reply; 10+ messages in thread
From: Vincent Hanquez @ 2010-06-22 7:44 UTC (permalink / raw)
To: Yu Zhiguo; +Cc: xen-devel@lists.xensource.com
On 22/06/10 08:32, Yu Zhiguo wrote:
> Running xenstore-* when xenstored is not started, it will hang and
> cannot accept any signal, e.g. SIGINT.
> I seems that the process is blocked at accessing '/proc/xen/xenbus'.
>
> # mount -t xenfs xenfs /proc/xen/
> # xenstore-ls
>
> call trace:
> do_ls() -> xs_directory() -> xs_talkv() -> xs_write_all() -> write()
>
> BLOCK is no problem but why process cannot accept signal, Any opinion?
>
>
> If start xenstored in other console, xenstore-ls executes and then
> receive the signal, seems the signal is pended...
>
That's the common behavior of task stuck in a kernel operation (ps aux
will show the task at D, and /proc/<pid>/wchan will tell you exactly
where it's blocked in the kernel).
the write is going to wait for a xenstored reply in kernel mode since by
default the xenstore-* tools use the kernel xenstore page to communicate
with xenstored.
The unix socket operations doesn't have this "problems" (xenstore-* -s)
--
Vincent
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:32 why xenstore-* hangs if xenstored is not started Yu Zhiguo
2010-06-22 7:44 ` Vincent Hanquez
@ 2010-06-22 7:45 ` Keir Fraser
2010-06-22 7:56 ` Vincent Hanquez
2010-06-22 8:12 ` Yu Zhiguo
1 sibling, 2 replies; 10+ messages in thread
From: Keir Fraser @ 2010-06-22 7:45 UTC (permalink / raw)
To: Yu Zhiguo, xen-devel@lists.xensource.com
On 22/06/2010 08:32, "Yu Zhiguo" <yuzg@cn.fujitsu.com> wrote:
> Running xenstore-* when xenstored is not started, it will hang and
> cannot accept any signal, e.g. SIGINT.
> I seems that the process is blocked at accessing '/proc/xen/xenbus'.
>
> # mount -t xenfs xenfs /proc/xen/
> # xenstore-ls
>
> call trace:
> do_ls() -> xs_directory() -> xs_talkv() -> xs_write_all() -> write()
>
> BLOCK is no problem but why process cannot accept signal, Any opinion?
Does the xenstore driver in the dom0 kernel put the process into
uninterruptible sleep? The 2.6.18 kernel simply returns -ENODEV in this case
I think. So perhaps pv_ops has different and inferior behaviour. At least
using interruptible sleep would be preferable.
-- Keir
> If start xenstored in other console, xenstore-ls executes and then
> receive the signal, seems the signal is pended...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:45 ` Keir Fraser
@ 2010-06-22 7:56 ` Vincent Hanquez
2010-06-22 8:06 ` Keir Fraser
2010-06-22 8:12 ` Yu Zhiguo
1 sibling, 1 reply; 10+ messages in thread
From: Vincent Hanquez @ 2010-06-22 7:56 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com, Yu Zhiguo
On 22/06/10 08:45, Keir Fraser wrote:
> Does the xenstore driver in the dom0 kernel put the process into
> uninterruptible sleep? The 2.6.18 kernel simply returns -ENODEV in this case
> I think. So perhaps pv_ops has different and inferior behaviour.
the behavior was the same in 2.6.18.
--
Vincent
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:44 ` Vincent Hanquez
@ 2010-06-22 7:58 ` Yu Zhiguo
2010-06-22 8:27 ` Vincent Hanquez
0 siblings, 1 reply; 10+ messages in thread
From: Yu Zhiguo @ 2010-06-22 7:58 UTC (permalink / raw)
To: Vincent Hanquez; +Cc: xen-devel@lists.xensource.com
Hi,
Vincent Hanquez wrote:
> That's the common behavior of task stuck in a kernel operation (ps aux
> will show the task at D, and /proc/<pid>/wchan will tell you exactly
> where it's blocked in the kernel).
>
> the write is going to wait for a xenstored reply in kernel mode since by
> default the xenstore-* tools use the kernel xenstore page to communicate
> with xenstored.
>
> The unix socket operations doesn't have this "problems" (xenstore-* -s)
>
Thanks~~
I confirmed the task is at D+ and there are no this "problem" if use option -s.
But I think S+ is better than D+...
Yu
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:56 ` Vincent Hanquez
@ 2010-06-22 8:06 ` Keir Fraser
2010-06-22 8:26 ` Vincent Hanquez
0 siblings, 1 reply; 10+ messages in thread
From: Keir Fraser @ 2010-06-22 8:06 UTC (permalink / raw)
To: Vincent Hanquez; +Cc: xen-devel@lists.xensource.com, Yu Zhiguo
On 22/06/2010 08:56, "Vincent Hanquez" <Vincent.Hanquez@eu.citrix.com>
wrote:
> On 22/06/10 08:45, Keir Fraser wrote:
>> Does the xenstore driver in the dom0 kernel put the process into
>> uninterruptible sleep? The 2.6.18 kernel simply returns -ENODEV in this case
>> I think. So perhaps pv_ops has different and inferior behaviour.
>
> the behavior was the same in 2.6.18.
Ah, I just see 'if (!is_xenstored_ready()) return -ENODEV' in 2.6.18's
xenbus_dev.c. I assumed that would have an effect on this case.
-- Keir
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:45 ` Keir Fraser
2010-06-22 7:56 ` Vincent Hanquez
@ 2010-06-22 8:12 ` Yu Zhiguo
1 sibling, 0 replies; 10+ messages in thread
From: Yu Zhiguo @ 2010-06-22 8:12 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com
Hi Keir,
Keir Fraser wrote:
>>
>> BLOCK is no problem but why process cannot accept signal, Any opinion?
>
> Does the xenstore driver in the dom0 kernel put the process into
> uninterruptible sleep? The 2.6.18 kernel simply returns -ENODEV in this case
> I think. So perhaps pv_ops has different and inferior behaviour. At least
> using interruptible sleep would be preferable.
>
Yes, the process is uninterruptible.
I agree with you, interruptible sleep is user-friendliness.
Yu
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 8:06 ` Keir Fraser
@ 2010-06-22 8:26 ` Vincent Hanquez
0 siblings, 0 replies; 10+ messages in thread
From: Vincent Hanquez @ 2010-06-22 8:26 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com, Yu Zhiguo
On 22/06/10 09:06, Keir Fraser wrote:
> On 22/06/2010 08:56, "Vincent Hanquez"<Vincent.Hanquez@eu.citrix.com>
> wrote:
>
>> On 22/06/10 08:45, Keir Fraser wrote:
>>> Does the xenstore driver in the dom0 kernel put the process into
>>> uninterruptible sleep? The 2.6.18 kernel simply returns -ENODEV in this case
>>> I think. So perhaps pv_ops has different and inferior behaviour.
>>
>> the behavior was the same in 2.6.18.
>
> Ah, I just see 'if (!is_xenstored_ready()) return -ENODEV' in 2.6.18's
> xenbus_dev.c. I assumed that would have an effect on this case.
hm, maybe it does afterall, and I'm confuse this with a more general
case; the D state would happens if xenstored doesn't want to reply or is
dead. This behavior has been there as long as I can remember.
I'm pretty sure though that a while ago (relatively old XenServer
kernel) starting a xenstore-* without starting xenstored would make it
stuck until xenstored start.
--
Vincent
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 7:58 ` Yu Zhiguo
@ 2010-06-22 8:27 ` Vincent Hanquez
2010-06-22 8:46 ` Yu Zhiguo
0 siblings, 1 reply; 10+ messages in thread
From: Vincent Hanquez @ 2010-06-22 8:27 UTC (permalink / raw)
To: Yu Zhiguo; +Cc: xen-devel@lists.xensource.com
On 22/06/10 08:58, Yu Zhiguo wrote:
> Hi,
>
> Vincent Hanquez wrote:
>
>> That's the common behavior of task stuck in a kernel operation (ps aux
>> will show the task at D, and /proc/<pid>/wchan will tell you exactly
>> where it's blocked in the kernel).
>>
>> the write is going to wait for a xenstored reply in kernel mode since by
>> default the xenstore-* tools use the kernel xenstore page to communicate
>> with xenstored.
>>
>> The unix socket operations doesn't have this "problems" (xenstore-* -s)
>>
>
> Thanks~~
> I confirmed the task is at D+ and there are no this "problem" if use option -s.
> But I think S+ is better than D+...
I don't think it's very easy to have interruptible sleep here, it would
change radically the protocol. the kernel xenstored page need to be
handled "atomically" since requests and their replied cannot be
intertwined. Maybe a timeout would be the one requiring the less change ?
--
Vincent
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: why xenstore-* hangs if xenstored is not started
2010-06-22 8:27 ` Vincent Hanquez
@ 2010-06-22 8:46 ` Yu Zhiguo
0 siblings, 0 replies; 10+ messages in thread
From: Yu Zhiguo @ 2010-06-22 8:46 UTC (permalink / raw)
To: Vincent Hanquez; +Cc: xen-devel@lists.xensource.com
Hi Vincent,
Vincent Hanquez wrote:
>>
>> Thanks~~
>> I confirmed the task is at D+ and there are no this "problem" if use
>> option -s.
>> But I think S+ is better than D+...
>
> I don't think it's very easy to have interruptible sleep here, it would
> change radically the protocol. the kernel xenstored page need to be
> handled "atomically" since requests and their replied cannot be
> intertwined. Maybe a timeout would be the one requiring the less change ?
>
I'm not familiar with those code and not sure how can fix it,
but I think a timeout is better than doing nothing.
--
Regards
Yu Zhiguo
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-06-22 8:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 7:32 why xenstore-* hangs if xenstored is not started Yu Zhiguo
2010-06-22 7:44 ` Vincent Hanquez
2010-06-22 7:58 ` Yu Zhiguo
2010-06-22 8:27 ` Vincent Hanquez
2010-06-22 8:46 ` Yu Zhiguo
2010-06-22 7:45 ` Keir Fraser
2010-06-22 7:56 ` Vincent Hanquez
2010-06-22 8:06 ` Keir Fraser
2010-06-22 8:26 ` Vincent Hanquez
2010-06-22 8:12 ` Yu Zhiguo
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).