aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/sched.h
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2011-09-05 15:10:09 +0100
committerOlaf Hering <olaf@aepfle.de>2011-09-05 15:10:09 +0100
commit46d0343de0799a1dd77fbf996e878dd6cc56826e (patch)
treec97fbe9c26bbe4aa5d3b9eadace3dbecf498cf0d /xen/include/xen/sched.h
parentfdf21233645251000b1c8c9c24fb0e8cd6e2ee24 (diff)
downloadxen-46d0343de0799a1dd77fbf996e878dd6cc56826e.tar.gz
xen-46d0343de0799a1dd77fbf996e878dd6cc56826e.tar.bz2
xen-46d0343de0799a1dd77fbf996e878dd6cc56826e.zip
mem_event: add ref counting for free requestslots
If mem_event_check_ring() is called by many vcpus at the same time before any of them called also mem_event_put_request(), all of the callers must assume there are enough free slots available in the ring. Record the number of request producers in mem_event_check_ring() to keep track of available free slots. Add a new mem_event_put_req_producers() function to release a request attempt made in mem_event_check_ring(). Its required for p2m_mem_paging_populate() because that function can only modify the p2m type if there are free request slots. But in some cases p2m_mem_paging_populate() does not actually have to produce another request when it is known that the same request was already made earlier by a different vcpu. mem_event_check_ring() can not return a reference to a free request slot because there could be multiple references for different vcpus and the order of mem_event_put_request() calls is not known. As a result, incomplete requests could be consumed by the ring user. Signed-off-by: Olaf Hering <olaf@aepfle.de>
Diffstat (limited to 'xen/include/xen/sched.h')
-rw-r--r--xen/include/xen/sched.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 902cd07418..2bda1edd7b 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -183,6 +183,7 @@ struct mem_event_domain
{
/* ring lock */
spinlock_t ring_lock;
+ unsigned int req_producers;
/* shared page */
mem_event_shared_page_t *shared_page;
/* shared ring page */