mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 01:08:55 +00:00
core: store new affinity on successful migration
Adjust the base-* platforms to acknowledge new thread location solely if migration is supported and succeeded. Otherwise the wrong thread locations are observed via the trace session and utilization time calculation get wrong. Issue #3842
This commit is contained in:
committed by
Christian Helmuth
parent
99fa203673
commit
90bea1499e
@ -221,19 +221,16 @@ Foc_thread_state Platform_thread::state()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::affinity(Affinity::Location location)
|
||||
void Platform_thread::affinity(Affinity::Location const location)
|
||||
{
|
||||
_location = location;
|
||||
|
||||
int const cpu = location.xpos();
|
||||
|
||||
l4_sched_param_t params = l4_sched_param(_prio);
|
||||
params.affinity = l4_sched_cpu_set(cpu, 0, 1);
|
||||
l4_msgtag_t tag = l4_scheduler_run_thread(L4_BASE_SCHEDULER_CAP,
|
||||
_thread.local.data()->kcap(), ¶ms);
|
||||
if (l4_error(tag))
|
||||
warning("setting affinity of ", Hex(_thread.local.data()->kcap()),
|
||||
" to ", cpu, " failed!");
|
||||
if (!l4_error(tag))
|
||||
_location = location;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user