waitqueue: increase stack array
PATCH 1/1 waitqueue: increase stack array
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1320773665 -3600
# Node ID 455f064fe54eeb57a43aa0c45a56cc4c4847d7a0 # Parent c6f1423918baecb7a11eb7a151b9d5fb00888228
waitqueue: increase stack array
In my testing 1500 bytes were not enough, at least 1800 bytes were required. Allocate a whole page for waitqueue_vcpu and use the remainder as stack array.
Signed-off-by Olaf Hering <[email protected]>
xen/common/wait.c +6 -4
@@ -33,7 +33,8 @@ struct waitqueue_vcpu {* hypervisor context before sleeping (descheduling), setjmp/longjmp-style. */ void *esp; -char stack[1500 ]; +unsigned short stack_len; +char stack[0 ];#endif };
@@ -41,12 +42,13 @@ int init_waitqueue_vcpu(struct vcpu *v) {struct waitqueue_vcpu *wqv; - wqv = xzalloc(struct waitqueue_vcpu); + wqv =alloc_xenheap_page ();if ( wqv ==NULL )return -ENOMEM ;INIT_LIST_HEAD (&wqv->list); wqv->vcpu = v; + wqv->stack_len =PAGE_SIZE -sizeof (*wqv); v->waitqueue_vcpu = wqv;
@@ -62,7 +64,7 @@ void destroy_waitqueue_vcpu(struct vcpureturn ;BUG_ON (!list_empty (&wqv->list)); -xfree (wqv); +free_xenheap_page (wqv); v->waitqueue_vcpu =NULL ; }
@@ -114,7 +116,7 @@ static void __prepare_to_wait(struct wai : "=S" (wqv->esp) : "c" (cpu_info), "D" (wqv->stack) : "memory" ); -BUG_ON ((cpu_info - (char *)wqv->esp) >sizeof (wqv->stack)); +BUG_ON ((cpu_info - (char *)wqv->esp) > wqv->stack_len); }static void __finish_wait (struct waitqueue_vcpu *wqv)