Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tasks/runner_ops/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cargo ops provision <runner>

### CPU isolation boot args

Configure `isolcpus=`/`nohz_full=`/`rcu_nocbs=` kernel boot args for the benchmark cores via a GRUB drop-in (`/etc/default/grub.d/99-bencher-isolation.cfg`), then reboot the server and verify. This clears the runner preflight notice about missing isolation boot args. Idempotent: exits early if the cmdline already has the args (presence-only; it will not re-scope an existing CPU list, even with `--cpus`). The benchmark CPU list defaults to `1-(nproc-1)` (CPU 0 is housekeeping); override with `--cpus`.
Configure `isolcpus=`/`nohz_full=`/`rcu_nocbs=` kernel boot args for the benchmark cores via a GRUB drop-in (`/etc/default/grub.d/zz-bencher-isolation.cfg`, named to sort after provider drop-ins that overwrite `GRUB_CMDLINE_LINUX_DEFAULT`), then reboot the server and verify. This clears the runner preflight notice about missing isolation boot args. Idempotent: exits early if the cmdline already has the args (presence-only; it will not re-scope an existing CPU list, even with `--cpus`). The benchmark CPU list defaults to `1-(nproc-1)` (CPU 0 is housekeeping); override with `--cpus`.

```bash
cargo ops isolate <runner>
Expand Down
10 changes: 9 additions & 1 deletion tasks/runner_ops/src/task/isolate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use super::stop::stop_service;
use crate::parser::TaskIsolate;
use crate::parser::server::load_server;

const GRUB_DROP_IN: &str = "/etc/default/grub.d/99-bencher-isolation.cfg";
// The `zz-` prefix sorts this drop-in after provider drop-ins (e.g. Hetzner's
// `hetzner.cfg`) that overwrite GRUB_CMDLINE_LINUX_DEFAULT instead of
// appending; /etc/default/grub.d/*.cfg files are sourced in glob order.
const GRUB_DROP_IN: &str = "/etc/default/grub.d/zz-bencher-isolation.cfg";

#[derive(Debug)]
pub struct Isolate {
Expand Down Expand Up @@ -62,6 +65,11 @@ impl Isolate {
"mkdir -p /etc/default/grub.d && cat > {GRUB_DROP_IN} << 'GRUB_EOF'\n{cfg}\nGRUB_EOF"
))?;
ssh.run("update-grub")?;
if !ssh.check(&format!("grep -qF 'isolcpus={cpus}' /boot/grub/grub.cfg"))? {
anyhow::bail!(
"generated GRUB config is missing the isolation args; another /etc/default/grub.d drop-in may be overwriting GRUB_CMDLINE_LINUX_DEFAULT"
);
}

let boot_id = ssh.boot_id()?;
stop_service(&ssh)?;
Expand Down
Loading