|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] waitqueue: Hold a reference to a domain on a waitqueue.
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1322253125 0
# Node ID 95d4e2e0bed374602b5a78ee004b057ad8715d65
# Parent 2a81ce2b2b9374adc051768fcf940d161ecc34dd
waitqueue: Hold a reference to a domain on a waitqueue.
Also allow waitqueues to be dynamically destroyed.
Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/common/wait.c
--- a/xen/common/wait.c Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/common/wait.c Fri Nov 25 20:32:05 2011 +0000
@@ -87,6 +87,11 @@
INIT_LIST_HEAD(&wq->list);
}
+void destroy_waitqueue_head(struct waitqueue_head *wq)
+{
+ wake_up_all(wq);
+}
+
void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
{
struct waitqueue_vcpu *wqv;
@@ -98,6 +103,7 @@
wqv = list_entry(wq->list.next, struct waitqueue_vcpu, list);
list_del_init(&wqv->list);
vcpu_unpause(wqv->vcpu);
+ put_domain(wqv->vcpu->domain);
}
spin_unlock(&wq->lock);
@@ -218,6 +224,7 @@
spin_lock(&wq->lock);
list_add_tail(&wqv->list, &wq->list);
vcpu_pause_nosync(curr);
+ get_knownalive_domain(curr->domain);
spin_unlock(&wq->lock);
}
@@ -236,6 +243,7 @@
{
list_del_init(&wqv->list);
vcpu_unpause(curr);
+ put_domain(curr->domain);
}
spin_unlock(&wq->lock);
}
diff -r 2a81ce2b2b93 -r 95d4e2e0bed3 xen/include/xen/wait.h
--- a/xen/include/xen/wait.h Fri Nov 25 20:27:11 2011 +0000
+++ b/xen/include/xen/wait.h Fri Nov 25 20:32:05 2011 +0000
@@ -25,8 +25,9 @@
.list = LIST_HEAD_INIT((name).list) \
}
-/* Dynamically initialise a waitqueue. */
+/* Dynamically initialise/destroy a waitqueue. */
void init_waitqueue_head(struct waitqueue_head *wq);
+void destroy_waitqueue_head(struct waitqueue_head *wq);
/* Wake VCPU(s) waiting on specified waitqueue. */
void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |