mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
fix(power-trap-eacces): gracefully handle hypercall errors in power management (#325)
* daemon: reenable built-in power management policy * xenruntime: gracefully handle power management errors
This commit is contained in:
parent
dcffaf110e
commit
0358c9c775
@ -141,12 +141,12 @@ impl Daemon {
|
|||||||
|
|
||||||
// TODO: Create a way of abstracting early init tasks in kratad.
|
// TODO: Create a way of abstracting early init tasks in kratad.
|
||||||
// TODO: Make initial power management policy configurable.
|
// TODO: Make initial power management policy configurable.
|
||||||
// FIXME: Power management hypercalls fail when running as an L1 hypervisor.
|
let power = runtime.power_management_context().await?;
|
||||||
// let power = runtime.power_management_context().await?;
|
power.set_smt_policy(true).await?;
|
||||||
// power.set_smt_policy(true).await?;
|
power
|
||||||
// power
|
.set_scheduler_policy("performance".to_string())
|
||||||
// .set_scheduler_policy("performance".to_string())
|
.await?;
|
||||||
// .await?;
|
info!("power management initialized");
|
||||||
|
|
||||||
info!("krata daemon initialized");
|
info!("krata daemon initialized");
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
use log::info;
|
||||||
use xencall::sys::{CpuId, SysctlCputopo};
|
use xencall::sys::{CpuId, SysctlCputopo};
|
||||||
|
|
||||||
use crate::RuntimeContext;
|
use crate::RuntimeContext;
|
||||||
@ -151,7 +152,10 @@ impl PowerManagementContext {
|
|||||||
.xen
|
.xen
|
||||||
.call
|
.call
|
||||||
.set_turbo_mode(CpuId::All, enable)
|
.set_turbo_mode(CpuId::All, enable)
|
||||||
.await?;
|
.await
|
||||||
|
.unwrap_or_else(|error| {
|
||||||
|
info!("non-fatal error while setting SMT policy: {:?}", error);
|
||||||
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +165,10 @@ impl PowerManagementContext {
|
|||||||
.xen
|
.xen
|
||||||
.call
|
.call
|
||||||
.set_cpufreq_gov(CpuId::All, policy)
|
.set_cpufreq_gov(CpuId::All, policy)
|
||||||
.await?;
|
.await
|
||||||
|
.unwrap_or_else(|error| {
|
||||||
|
info!("non-fatal error while setting scheduler policy: {:?}", error);
|
||||||
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user