Skip to content

Conversation

@phip1611
Copy link
Member

@phip1611 phip1611 commented Aug 27, 2025

About

Accelerate cpu_manager.pause() massively.

Checklist (for Author)

  • libvirt-tests pipeline succeeded (currently this must be done manually locally)

Hints for Reviewers

  • Thomas needs to perform his live-migration benchmarking stress test
  • we need to figure out what causes the weird livemigration effects under load we currently see

Steps to Undraft (if draft)

None.

@phip1611 phip1611 self-assigned this Aug 27, 2025
@phip1611 phip1611 force-pushed the cyberus-fork-cpumanager-improvements branch from e0b36b1 to a96c203 Compare August 27, 2025 14:28
vmm/src/cpu.rs Outdated
Comment on lines 2299 to 2306
let old = self.vcpus_pause_signalled.swap(true, Ordering::SeqCst);
if old {
// Make pause() idempotent. This is helpful when the migration
// thread wants to stop the vCPUS but the vCPU throttle thread
// also just performed a .pause(). We don't use strong
// synchronization between these threads in all cases, as every
// ms counts for the migration thread to reach a low downtime.
return Ok(());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The throttle thread can only exit after resuming vcpus. I thus suggest reverting this part.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This reduces the time to pause all vCPUs from >254ms to 4ms for 254 CPUs.
The speedup comes from decoupling the loop into two:
- first signal all vCPUS
- then wait for all vCPUs to ACK
@phip1611 phip1611 force-pushed the cyberus-fork-cpumanager-improvements branch 2 times, most recently from a22eb39 to a29404b Compare September 1, 2025 16:08
Copy link

@olivereanderson olivereanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@olivereanderson olivereanderson merged commit d108f5d into cyberus-technology:gardenlinux Sep 2, 2025
40 of 42 checks passed
@phip1611 phip1611 deleted the cyberus-fork-cpumanager-improvements branch November 25, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants