Rate This Document
Findability
Accuracy
Completeness
Readability

Scheduling Mode Optimization

Purpose

Adjust the OS scheduling policy to improve the CPU usage and overall server performance.

Procedure

  1. Modify the kernel startup parameters.
    1. Open the file.
      1
      sudo vi /etc/default/grub
      
    2. Press i to enter the insert mode and add the following content:
      sched_steal_node_limit=4 kpti=off mitigation=off

      The following figure shows the modification result:

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    4. Make the modification take effect.
      1
      sudo grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
      
  2. Reboot the server for the new GRUB configuration to take effect.
    1
    reboot
    
  3. Enable the stealtask function.
    1. Write STEAL to the /sys/kernel/debug/sched_features file to enable the stealtask function.
      1
      echo STEAL > /sys/kernel/debug/sched_features
      
    2. Check the /proc/cmdline file and ensure that the added startup parameters have taken effect.
      cat /proc/cmdline

      The expected result is that /proc/cmdline contains the content added in 1.b.

    3. Check the content of the /sys/kernel/debug/sched_features file.
      cat /sys/kernel/debug/sched_features

      The STEAL state of the file indicates that the stealtask function has been enabled.