Skip to content

Latest commit

 

History

History
86 lines (68 loc) · 4.17 KB

README.md

File metadata and controls

86 lines (68 loc) · 4.17 KB

Dynamic Accelereted Linux kernel based on CentOS8s

Version: 4.18.0-394.el8.x86_64


Table of Contents


Overview

The Dynaccel kernel is a Linux kernel that can speed up the long-term testing process through accelerated kernel's flow of time. The ratio to which the time is accelerated can be changed dynamically through the kernel interface - /proc.

The idea originated from the repository.
A slides by the original authors (Toshiba) describing this work - PDF.

The kernel is based on the upstream CentOS8s kernel 4.18.0.

Kernel Installation

The Dynaccel kernel can be installed through a DNF update on a Centos8 Strean system:

  • Create dynaccel.repo file in the /etc/yum.repos.d/ folder
  • Add the following content to the created file:
[dynaccel]
name=dynaccel
baseurl=http://portugal.cdot.systems/dynaccel
gpgcheck=0
enabled=1

After the RPM repository is set up locally, a simple dnf update --refresh will install all the packages and update to the Dynaccel kernel.

Project Structure

  • kernel-sources - a folder containing the Dynaccel kernel source code. README.md
  • config-x86_64 - a reference of kernel config for x86_64 used for compilation.
  • dynaccel-patches.patch - a patch file containing the changes for the Dynaccel functionality.
  • kernel-4.18.0-394.el8.dynaccel.src.rpm - a SRC.RPM file containing sources for the RPM package build.

Kernel Usage

The speedup_ratio (acceleration) can be changed with sysctl.
Example: sysctl --write kernel.accel=50.
The current acceleration ratio can be accessed through cat /proc/sys/kernel/accel.

Source RPM Build

Below is the steps required to build the Dynaccel RPM packages:

  1. Install RPM Developer tools - sudo dnf -y install rpmdevtools or sudo yum -y install rpmdevtools.
  2. Set up the RPM build tree - rpmdev-setuptree and cd rpmbuild.

    RPMbuild tree
  3. Copy the *src.rpm to the SRPMS folder and install it - rpm -i kernel*src.rpm.
  4. Build the RPM:
    • With rpmbuild -bb --target=x86_64 SPECS/kernel.spec, if gcc-8 is present.
    • With mock utility - mock -r centos-stream-8-x86_64 *src.rpm, if gcc-8 is not present.
  5. Next steps would be to create and sign an RPM repository. Refer to the Wiki Page on how to do it.

Additionally, there is a good guide on the Fedora Wiki page on how to build a custom kernel RPM package.

Notes

  • The kernel.spec specifies EPOCH 1 for Dynaccel to take precedence over the latest kernel present in DNF.
  • Inner VM's installed under the Dynaccel kernel inherit the flow of time (accelerated as well).
    • However, an Inner VM's Watchdog that kernel should reset periodically does not function properly and goes off early. It causes kernel panics, making the system almost unusable.
      • The issue can temporarily be fixed by disabling the Watchdog with sysctl kernel.nmi_watchdog=0
      • To disable for subsequent boots add kernel.nmi_watchdog=0 line to /etc/sysctl.conf
  • The acceleration ratio can be adjusted in the range of 1 to 1000, but the 'stable' range is from 1 to 200.

Limitations

  • The kernel and SRC.RPM should be compiled under gcc-8 and g++-8, otherwise compilation will fail.
  • The Dynaccel patches were only applied and tested on kernel version 4.18.0.
  • It is not a hardware acceleration, so there isn't any performance boost, just accelerated time.