Linus Torvalds embraces Microsoft’s Hyper-V upgrade for faster boot times in next-gen Linux

Linus Torvalds embraces Microsoft’s Hyper-V upgrade for faster boot times in next-gen Linux

While enthusiasts of Windows and Linux frequently engage in heated keyboard battles, the developers of these operating systems recognize each other’s strengths and weaknesses. Microsoft, in particular, acknowledges this dynamic and actually encourages users to experiment with Linux, especially through its Windows Subsystem for Linux (WSL).

Moreover, Microsoft routinely releases updates aimed at enhancing Linux performance and functionality. A notable example is the introduction of nested virtualization or nested Hyper-V support in November 2022. Additionally, in September of the previous year, Linux creator Linus Torvalds accepted improvements related to Hyper-V for AMD SEV-SNP guests and Intel TDX guests that were proposed by Wei Liu, principal architect at Azure Machine Learning.

Recently, Torvalds has approved new Hyper-V updates from Liu for Linux 6.12, with a particular focus on performance enhancements highlighted by Microsoft’s Saurabh Singh Sengar:

Pull Hyper-V updates from Wei Liu:

  • Optimize boot time by concurrent execution of hv_synic_init() (Saurabh Sengar)
  • Utilize helpers to read control registers in hv_snp_boot_ap() (Yosry Ahmed)
  • Incorporate memory allocation check in hv_fcopy_start (Zhu Jun)

The patch description elaborates on how parallelizing the hv_synic_init() function can significantly enhance boot times for processors with a large number of cores and NUMA (non-uniform memory access) nodes:

Optimize boot time by concurrent execution of hv_synic_init()

On a massive system with 1780 CPUs, the hv_acpi_init() takes approximately 3 seconds to finish, primarily due to the sequential synic initialization handled by hv_synic_init().

By scheduling these tasks to occur concurrently, each CPU can run hv_synic_init() in parallel, thus maximizing the potential of multiple CPUs.

This optimization results in a boot time reduction of about 2 seconds on a 1780 CPU system, translating to roughly a 66% improvement over the previous method.

Sengar also recently delivered a presentation titled “Accelerating Linux Kernel Boot-Up for Large Multi-Core Systems,”which discusses the details of this patch and other ongoing optimizations. You can view the presentation here on the Linux Plumbers Conference (LPC) website.

Source: LKML (link1, link2)

Source

Leave a Reply

Your email address will not be published. Required fields are marked *