mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 14:13:09 +00:00
hw: reset scheduling timeout implicitely
This is needed as soon as we do inter-processor interrupts to inform a processor about a remote modification in its scheduling plan. In this case we can not explicitely decide wether to reset timer or not. Instead we must decide it according to the choices of the scheduler before and after the modification. ref #1088
This commit is contained in:
parent
a99a33e93e
commit
044a109c3a
@ -83,7 +83,7 @@ namespace Kernel
|
||||
/**
|
||||
* Start a new scheduling lap
|
||||
*/
|
||||
void reset_lap_time(unsigned const processor_id)
|
||||
void reset_scheduling_time(unsigned const processor_id)
|
||||
{
|
||||
unsigned const tics = timer()->ms_to_tics(USER_LAP_TIME_MS);
|
||||
timer()->start_one_shot(tics, processor_id);
|
||||
@ -268,7 +268,7 @@ extern "C" void init_kernel_multiprocessor()
|
||||
/* kernel initialization finished */
|
||||
init_platform();
|
||||
}
|
||||
reset_lap_time(processor_id);
|
||||
reset_scheduling_time(processor_id);
|
||||
}
|
||||
|
||||
|
||||
@ -291,14 +291,17 @@ extern "C" void kernel()
|
||||
* scheduling of the local activities in a way that an update would return
|
||||
* an occupant other than that whose exception caused the kernel entry.
|
||||
*/
|
||||
scheduler->occupant()->exception(processor_id);
|
||||
Execution_context * const old_occupant = scheduler->occupant();
|
||||
old_occupant->exception(processor_id);
|
||||
|
||||
/*
|
||||
* The processor local as well as remote exception-handling may have
|
||||
* changed the scheduling of the local activities. Hence we must update the
|
||||
* processor occupant.
|
||||
*/
|
||||
scheduler->update_occupant()->proceed(processor_id);
|
||||
Execution_context * const new_occupant = scheduler->update_occupant();
|
||||
if (old_occupant != new_occupant) { reset_scheduling_time(processor_id); }
|
||||
new_occupant->proceed(processor_id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -23,7 +23,6 @@ namespace Kernel
|
||||
{
|
||||
Pic * pic();
|
||||
Timer * timer();
|
||||
void reset_lap_time(unsigned const);
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +38,6 @@ void Kernel::Execution_context::_interrupt(unsigned const processor_id)
|
||||
/* handle scheduling timeout */
|
||||
__processor->scheduler()->yield_occupation();
|
||||
timer()->clear_interrupt(processor_id);
|
||||
reset_lap_time(processor_id);
|
||||
} else {
|
||||
|
||||
/* try to inform the user interrupt-handler */
|
||||
|
@ -33,8 +33,6 @@ unsigned Thread::pd_id() const { return _pd ? _pd->id() : 0; }
|
||||
|
||||
bool Thread::_core() const { return pd_id() == core_id(); }
|
||||
|
||||
namespace Kernel { void reset_lap_time(unsigned const processor_id); }
|
||||
|
||||
void Thread::_signal_context_kill_pending()
|
||||
{
|
||||
assert(_state == SCHEDULED);
|
||||
@ -251,7 +249,6 @@ void Thread::exception(unsigned const processor_id)
|
||||
default:
|
||||
PERR("unknown exception");
|
||||
_stop();
|
||||
reset_lap_time(processor_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -976,6 +973,5 @@ void Thread::_call(unsigned const processor_id)
|
||||
default:
|
||||
PERR("unknown kernel call");
|
||||
_stop();
|
||||
reset_lap_time(processor_id);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user