diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2012-07-12 12:17:29 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-07-28 13:04:29 -0500 |
commit | ac9ad22f261cd391c0d5163e82ff02ae4929f820 (patch) | |
tree | 5e6ab5b19095fdb5de9ce7d69517e9de9a27aa49 /src/lib/syscall_time.C | |
parent | f6b5db9e2298aa22b148f5a72d64a5564040c61a (diff) | |
download | talos-hostboot-ac9ad22f261cd391c0d5163e82ff02ae4929f820.tar.gz talos-hostboot-ac9ad22f261cd391c0d5163e82ff02ae4929f820.zip |
Reduce timeslice for idle task based on wake time of sleeping tasks
RTC: 43738
Change-Id: I91c2bfe57bba04a02dd5169542de8e76e1654ae8
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1387
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/lib/syscall_time.C')
-rw-r--r-- | src/lib/syscall_time.C | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/lib/syscall_time.C b/src/lib/syscall_time.C index 819b605b0..2fb56cb68 100644 --- a/src/lib/syscall_time.C +++ b/src/lib/syscall_time.C @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/lib/syscall_time.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2010 - 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/lib/syscall_time.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2010-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #include <time.h> #include <sys/time.h> #include <sys/syscall.h> @@ -30,7 +31,11 @@ using namespace Systemcalls; void nanosleep(uint64_t sec, uint64_t nsec) { - _syscall2(TIME_NANOSLEEP, (void*)sec, (void*)nsec); + // If the delay is short then simpleDelay() will perform the delay + if(unlikely(!TimeManager::simpleDelay(sec, nsec))) + { + _syscall2(TIME_NANOSLEEP, (void*)sec, (void*)nsec); + } } int clock_gettime(clockid_t clk_id, timespec_t* tp) |