From: Peter Dinda Date: Wed, 27 Jun 2012 02:24:38 +0000 (-0500) Subject: Corrected timed yield X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f7141b61d0c58befc5433a22d9af728fe3bb6f9;p=palacios.git Corrected timed yield --- diff --git a/linux_module/palacios-stubs.c b/linux_module/palacios-stubs.c index 78759d0..eea613b 100644 --- a/linux_module/palacios-stubs.c +++ b/linux_module/palacios-stubs.c @@ -519,7 +519,10 @@ palacios_yield_cpu(void) */ void palacios_yield_cpu_timed(unsigned int us) { - unsigned int jiffies = 1000000U * HZ / us; + + unsigned int uspj = 1000000U/HZ; + + unsigned int jiffies = us/uspj + ((us%uspj) !=0); // ceiling set_current_state(TASK_INTERRUPTIBLE);