nova: remove timer delay heuristic
The commit uses a fixed kernel branch (r8), which fixes a caching bug observable in the Genode host. The quirk detecting the circumstance in the timer service is obsolete now and is removed. Fixes #1338
This commit is contained in:
parent
1d920fa1b5
commit
8842ba2e1c
|
@ -1 +1 @@
|
||||||
d5f067a88da045f9fc6f9adb0ce532de0d4c047c
|
0c75755a7d208d1f114b25becd129c760d57f456
|
||||||
|
|
|
@ -3,8 +3,8 @@ VERSION := git
|
||||||
DOWNLOADS := nova.git
|
DOWNLOADS := nova.git
|
||||||
|
|
||||||
URL(nova) := https://github.com/alex-ab/NOVA.git
|
URL(nova) := https://github.com/alex-ab/NOVA.git
|
||||||
# r7 branch
|
# r8 branch
|
||||||
REV(nova) := 2b4f2803218cf92e2982b47a370d60b18bb78a15
|
REV(nova) := 41868231ae25678e1f2e344e40fbdbd0fd13e8ee
|
||||||
DIR(nova) := src/kernel/nova
|
DIR(nova) := src/kernel/nova
|
||||||
|
|
||||||
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
PATCHES := $(wildcard $(REP_DIR)/patches/*.patch)
|
||||||
|
|
|
@ -99,13 +99,6 @@ class Platform_timer
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
using namespace Nova;
|
using namespace Nova;
|
||||||
|
|
||||||
/* XXX quirk start - description below */
|
|
||||||
static unsigned short quirk_count = 0;
|
|
||||||
static unsigned int delay = 0;
|
|
||||||
Trace::Timestamp before = Trace::timestamp();
|
|
||||||
asm volatile ("":::"memory");
|
|
||||||
/* XXX quirk end */
|
|
||||||
|
|
||||||
if (_sem == ~0UL)
|
if (_sem == ~0UL)
|
||||||
_sem = blocking_thread->tid().exc_pt_sel + SM_SEL_EC;
|
_sem = blocking_thread->tid().exc_pt_sel + SM_SEL_EC;
|
||||||
|
|
||||||
|
@ -123,41 +116,6 @@ class Platform_timer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* XXX quirk start
|
|
||||||
*
|
|
||||||
* On some x86 platforms, it happens that the system seems to slow
|
|
||||||
* down dramatically for some unclear reasons so far. When this
|
|
||||||
* happens, the handling of the timeout queue and reprogramming the
|
|
||||||
* next timeout takes so long that the timer IRQ will fire
|
|
||||||
* immediately after acknowledging it. This causes the timer
|
|
||||||
* service to run on a very high rate, which may utilize the CPU
|
|
||||||
* close to the maximum. We try to detect this condition by the
|
|
||||||
* following heuristic and apply this quirk, which programs the
|
|
||||||
* next timeout later in time - so that it will fire not
|
|
||||||
* immediately after acknowledging it.
|
|
||||||
*
|
|
||||||
* This quirk should be removed as soon as it is clear what
|
|
||||||
* triggers the phenomenon.
|
|
||||||
*/
|
|
||||||
unsigned long diff = _time_in_us(now - before, false);
|
|
||||||
|
|
||||||
if (diff)
|
|
||||||
quirk_count++;
|
|
||||||
else {
|
|
||||||
quirk_count = 0;
|
|
||||||
delay = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (quirk_count > 10) {
|
|
||||||
delay += 10000;
|
|
||||||
us_64 += delay;
|
|
||||||
PWRN("apply timer quirk - diff=%lu, delay timeout %lu->%llu us",
|
|
||||||
diff, _timeout, us_64);
|
|
||||||
quirk_count = 0;
|
|
||||||
}
|
|
||||||
/* XXX quirk end */
|
|
||||||
|
|
||||||
/* block until timeout fires or it gets canceled */
|
/* block until timeout fires or it gets canceled */
|
||||||
unsigned long long tsc_absolute = now + us_64 * (_tsc_khz / TSC_FACTOR);
|
unsigned long long tsc_absolute = now + us_64 * (_tsc_khz / TSC_FACTOR);
|
||||||
Genode::uint8_t res = sm_ctrl(sem, SEMAPHORE_DOWN, tsc_absolute);
|
Genode::uint8_t res = sm_ctrl(sem, SEMAPHORE_DOWN, tsc_absolute);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user