From: Paul Durrant Date: Tue, 19 Jul 2016 13:13:51 +0000 (+0100) Subject: Reduce priority of suspend thread X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e58019787f528c0dfc68454108080385c7c7651f;p=people%2Fpauldu%2Fxenbus.git Reduce priority of suspend thread In cycles of repeated suspend/resume attempt to make sure other threads get to run by: a) Dropping the priority of the suspend thread as low as possible. b) Deliberately waiting for DPSc on other CPUs to complete before checking xenstore again. Signed-off-by: Paul Durrant --- diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c index da5cdcc..ce4d4ac 100644 --- a/src/xenbus/fdo.c +++ b/src/xenbus/fdo.c @@ -1462,6 +1462,9 @@ FdoSuspend( Affinity.Mask = (KAFFINITY)1; KeSetSystemGroupAffinityThread(&Affinity, NULL); + (VOID) KeSetPriorityThread(KeGetCurrentThread(), + LOW_PRIORITY); + Event = ThreadGetEvent(Self); for (;;) { @@ -1522,6 +1525,8 @@ FdoSuspend( __FdoSuspendClearActive(Fdo); + KeFlushQueuedDpcs(); + loop: KeSetEvent(&Fdo->SuspendEvent, IO_NO_INCREMENT, FALSE); }