我要评分
获取效率
正确性
完整性
易理解

Enabling the steal task Function

Enable the steal task function to optimize system scheduling.

When a process is being executed and another process needs to be executed but no CPU time slice is available, the steal task function preempts some CPU time slices from the running process and allocates them to the process to be executed.

  1. Check whether the current kernel supports the steal task function.
    cat /sys/kernel/debug/sched_features |tr " " "\n" |grep STEAL

    If the command output contains STEAL or NO_STEAL (NO_STEAL indicates that the steal task function exists but may be disabled), the current kernel supports the steal task function.

  2. Configure the steal task function.
    1. Open the file.
      vim /etc/default/grub
    2. Press i to enter the insert mode and modify the startup parameters.
      Find the GRUB_CMDLINE_LINUX line in the file and add the following content:
      sched_steal_node_limit=8

      In the preceding command, 8 indicates the number of NUMA nodes. Change the number to the actual one in your case.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Generate a new GRUB configuration file.
    grub2-mkconfig -o /boot/efi/EFI/bclinux/grub.cfg
  4. Restart the OS for the GRUB configuration modification to take effect.
    reboot
  5. Write STEAL to the /sys/kernel/debug/sched_features file to enable the steal task function.
    echo STEAL > /sys/kernel/debug/sched_features

    To disable the steal task function, run the following command:

    echo NO_STEAL > /sys/kernel/debug/sched_features