Skip to contentSkip to conversation

HVM restart issue

PATCH Yang, Xiaowei 3 participants 7 messages Mar 12, 2009

lore
Share & tools
lore
#0 lore raw

Recently I found HVM restart (destroy + start) is very slowly and the reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not be notified until /local/domain/hvm_id is removed in xenstore. udev event is then generated and xen-hotplug-cleanup is called. So the first xenstore-read will always fail and leave rest undone and xenstore unclean. Suggestion is to move it after backend/frontend removal.

Another interesting thing is that in function claim_lock, "release_lock $1; sigerr" is registered as ERR handler. However it seems its scope in effect is within the function. After claim_lock returns, the handler restores to the previous one ("sigerr") on my machine. So when the above error happens, the first script exits without calling release_lock. It keeps the following script waiting. Is this a correct BASH behavior?

Thanks,
xiaowei

tools/hotplug/Linux/xen-hotplug-cleanup Mon Mar 02 10:34:37 2009 +0000 renamed from tools/hotplug/Linux/xen-hotplug-cleanup Mon Mar 02 10:32:32 2009 +0000 +0 -0
diff -r 16fc70ce40a7 -r b3774712e654 tools/hotplug/Linux/xen-hotplug-cleanup
@@ -11,6 +11,13 @@ dir=$(dirname "$0")
 # This is pretty horrible, but there's not really a nicer way of 

solving this.
claim_lock "block"

+# split backend/DEVCLASS/VMID/DEVID on slashes +path_array=( ${XENBUS_PATH//\// } )
+# get /vm/UUID path
+vm=$(xenstore-read "/local/domain/${path_array[2]}/vm") +# construct /vm/UUID/device/DEVCLASS/DEVID +vm_dev="$vm/device/${path_array[1]}/${path_array[3]}" +

 # remove device frontend store entries
 xenstore-rm -t \
   $(xenstore-read "$XENBUS_PATH/frontend" 2>/dev/null) 2>/dev/null || true
@@ -19,4 +26,7 @@ xenstore-rm -t "$XENBUS_PATH"        2>/
 xenstore-rm -t "$XENBUS_PATH"        2>/dev/null || true
 xenstore-rm -t "error/$XENBUS_PATH"  2>/dev/null || true

+# remove device path from /vm/UUID
+xenstore-rm -t "$vm_dev" 2>/dev/null || true
+
release_lock "block"

#1 lore raw
Quoted 8 lines · Xiaowei

Recently I found HVM restart (destroy + start) is very slowly and the reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not be notified until /local/domain/hvm_id is removed in xenstore. udev event is then generated and xen-hotplug-cleanup is called. So the first xenstore-read will always fail and leave rest undone and xenstore unclean. Suggestion is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I will revert it until a better version is proposed.

-- Keir

#2 lore raw

How long it takes to push changes to http://xenbits.xensource.com/xen-unstable.hg

Boris

--- On Thu, 3/12/09, Keir Fraser <[email protected]> wrote:
From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "Yang, Xiaowei" <[email protected]>, "[email protected]" <[email protected]>
Date: Thursday, March 12, 2009, 4:31 AM

Quoted 8 lines · Xiaowei

Recently I found HVM restart (destroy + start) is very slowly and the reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not be notified until /local/domain/hvm_id is removed in xenstore. udev event is then generated and xen-hotplug-cleanup is called. So the first xenstore-read will always fail and leave rest undone and xenstore unclean. Suggestion is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I will revert it until a better version is proposed.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

That one is there already.

-- Keir

Quoted 38 lines · Boris Derzhavets

How long it takes to push changes to
http://xenbits.xensource.com/xen-unstable.hg

Boris

Quoted 30 lines · Keir Fraser

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "Yang, Xiaowei" <[email protected]>, "[email protected]" <[email protected]>
Date: Thursday, March 12, 2009, 4:31 AM

Quoted 4 lines · Xiaowei

Recently I found HVM restart (destroy + start) is very slowly and the reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not be

notified

Quoted 4 lines

until /local/domain/hvm_id is removed in xenstore. udev event is then generated and xen-hotplug-cleanup is called. So the first xenstore-read will always fail and leave rest undone and xenstore unclean. Suggestion is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I will revert it until a better version is proposed.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

I've just made a fresh clone of "xen unstable" with 19317 changesets. 19314 resolves the issue with hotplug scripts.
Please advise, how to add the most recent ,went in, without recreating folder xen-unstable.hg and complete new clone.

Boris.

--- On Thu, 3/12/09, Keir Fraser <[email protected]> wrote:
From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "[email protected]" <[email protected]>, "Yang, Xiaowei" <[email protected]>, "[email protected]" <[email protected]>
Date: Thursday, March 12, 2009, 7:18 AM

That one is there already.

-- Keir

Quoted 9 lines · Boris Derzhavets

How long it takes to push changes to
http://xenbits.xensource.com/xen-unstable.hg

Boris

Quoted 3 lines · Keir Fraser

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "Yang, Xiaowei" <[email protected]>,

"[email protected]"

Quoted 4 lines
Quoted 4 lines

<[email protected]>
Date: Thursday, March 12, 2009, 4:31 AM

On 12/03/2009 08:15, "Yang, Xiaowei"

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 1 line · wrote:

Recently I found HVM restart (destroy + start) is very slowly and

the

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not be

notified

Quoted 1 line

until /local/domain/hvm_id is removed in xenstore. udev event is

then

Quoted 1 line
Quoted 1 line
Quoted 1 line

generated and xen-hotplug-cleanup is called. So the first

xenstore-read

Quoted 1 line
Quoted 1 line
Quoted 1 line

will always fail and leave rest undone and xenstore unclean.

Suggestion

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I will

revert it

Quoted 12 lines
Quoted 10 lines

until a better version is proposed.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

hg pull ­u

K.

Quoted 79 lines · Boris Derzhavets

I've just made a fresh clone of "xen unstable" with 19317 changesets. 19314 resolves the issue with hotplug scripts.
Please advise, how to add the most recent ,went in, without recreating folder xen-unstable.hg and complete new clone.

Boris.

Quoted 69 lines · Keir Fraser

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "[email protected]" <[email protected]>, "Yang, Xiaowei" <[email protected]>, "[email protected]" <[email protected]>
Date: Thursday, March 12, 2009, 7:18 AM

That one is there already.

-- Keir

Quoted 9 lines · Boris Derzhavets

How long it takes to push changes to
http://xenbits.xensource.com/xen-unstable.hg

Boris

Quoted 3 lines · Keir Fraser

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "Yang, Xiaowei" <[email protected]>,

"[email protected]"

Quoted 4 lines
Quoted 4 lines

<[email protected]>
Date: Thursday, March 12, 2009, 4:31 AM

On 12/03/2009 08:15, "Yang, Xiaowei"

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 1 line · wrote:

Recently I found HVM restart (destroy + start) is very slowly and

the

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not

be

Quoted 2 lines
Quoted 2 lines

notified

Quoted 1 line

until /local/domain/hvm_id is removed in xenstore. udev event is

then

Quoted 1 line
Quoted 1 line
Quoted 1 line

generated and xen-hotplug-cleanup is called. So the first

xenstore-read

Quoted 1 line
Quoted 1 line
Quoted 1 line

will always fail and leave rest undone and xenstore unclean.

Suggestion

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I will

revert it

Quoted 12 lines
Quoted 10 lines

until a better version is proposed.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing
list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw

Thank you, Keir.

--- On Thu, 3/12/09, Keir Fraser <[email protected]> wrote:
From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "[email protected]" <[email protected]>, "Yang, Xiaowei" <[email protected]>, "[email protected]" <[email protected]>
Date: Thursday, March 12, 2009, 11:03 AM

hg pull ­u

K.

Quoted 1 line · Boris Derzhavets

I've just made a fresh clone of "xen unstable" with 19317

changesets.

Quoted 10 lines

19314 resolves the issue with hotplug scripts.
Please advise, how to add the most recent ,went in, without recreating folder xen-unstable.hg and complete new clone.

Boris.

Quoted 3 lines · Keir Fraser

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "[email protected]" <[email protected]>,

"Yang, Xiaowei"

Quoted 1 line
Quoted 1 line

<[email protected]>,

"[email protected]"

Quoted 17 lines
Quoted 17 lines

<[email protected]>
Date: Thursday, March 12, 2009, 7:18 AM

That one is there already.

-- Keir

Quoted 6 lines · Boris Derzhavets

How long it takes to push changes to
http://xenbits.xensource.com/xen-unstable.hg

Boris

--- On Thu, 3/12/09, Keir Fraser <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

From: Keir Fraser <[email protected]>
Subject: Re: [Xen-devel] HVM restart issue
To: "Yang, Xiaowei" <[email protected]>,

"[email protected]"

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

<[email protected]>
Date: Thursday, March 12, 2009, 4:31 AM

On 12/03/2009 08:15, "Yang, Xiaowei"

<[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 1 line · wrote:

Recently I found HVM restart (destroy + start) is very

slowly and

Quoted 7 lines
Quoted 7 lines

the

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

reason is the change to xen-hotplug-cleanup (see below).

When HVM is destroyed, backend vbd/vnif drivers will not

be

Quoted 2 lines
Quoted 2 lines

notified

Quoted 1 line

until /local/domain/hvm_id is removed in xenstore. udev

event is

Quoted 4 lines
Quoted 4 lines

then

Quoted 1 line
Quoted 1 line
Quoted 1 line

generated and xen-hotplug-cleanup is called. So the first

xenstore-read

Quoted 1 line
Quoted 1 line
Quoted 1 line

will always fail and leave rest undone and xenstore

unclean.

Quoted 4 lines
Quoted 4 lines

Suggestion

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

is to move it after backend/frontend removal.

I think 19250 has been causing problems for lots of people. I

will

Quoted 16 lines
Quoted 16 lines

revert it

Quoted 12 lines
Quoted 10 lines

until a better version is proposed.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Quoted 7 lines
Quoted 5 lines

_______________________________________________
Xen-devel mailing
list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel