Long-Term Supported Versions

    Innovation Versions

      Kernel FDO User Guide

      Overview

      The feedback-directed optimization (FDO) of the kernel allows users to build optimized kernels for different applications to improve the application performance in single-application scenarios. In addition, FDO is integrated GCC for openEuler, and A-FOT provides automatic optimization, enabling users to easily enable FDO.

      Installation and Deployment

      Software Requirements

      • OS: openEuler 23.09

      Hardware Requirements

      • Architecture: AArch64 or x86_64

      Software Installation

      Downloading the Kernel Source Code

      Download the kernel source code, A-FOT, and dependency packages.

      yum install -y kernel-source A-FOT make gcc flex bison elfutils-libelf-devel diffutils openssl-devel dwarves
      

      Copy the kernel source code.

      cp -r /usr/src/linux-6.4.0-8.0.0.16.oe2309.aarch64 .
      

      Note: Change the version number as required.

      Usage

      You can use A-FOT to enable kernel FDO and obtain the optimized kernel by specifying opt_mode as Auto_kernel_PGO. Other configuration items can be specified on the CLI, for example, ./a-fot --pgo_phase 1. -s and -n options can be specified on CLI only. Options related to kernel FDO are as follows.

      No.Option (Configuration File)DescriptionDefault Value
      1config_filePath of the configuration file. User configurations are read from this file.${afot_path}/a-fot.ini
      2opt_modeOptimization mode to be executed by the tool. The value can be AutoFDO, AutoPrefetch, AutoBOLT, or Auto_kernel_PGO.AutoPrefetch
      3pgo_modeKernel FDO mode, which can be arc (GCOV, using only the arc profile) or all (full PGO, using the arc and value profiles).all
      4pgo_phaseFDO execution phase. The value can be 1 (kernel instrumentation phase) or 2 (data collection and kernel optimization phase).1
      5kernel_srcKernel source code directory. If this option is not specified, the tool automatically downloads the source code.None (optional)
      6kernel_nameFile name of the kernel build. The tool will add the -pgoing or -pgoed suffix depending on the phase.kernel
      7work_pathScript working directory, which is used to store log files, wrappers, and profiles./opt (/tmp cannot be used.)
      8run_scriptApplication execution script. The user needs to write the script, which will be used by the tool to execute the target application./root/run.sh
      9gcc_pathGCC path./usr
      10-sSilent mode. The tool automatically reboots and switches the kernel to execute the second phase.None
      11-nThe tool is not used to compile the kernel. This option applies to the scenario where the execution environment and kernel compilation environment are different.None

      After configuring the compilation options, run the following command to use A-FOT to automatically optimize the kernel:

      a-fot --config_file ./a-fot.ini -s
      

      Note: The -s option instructs A-FOT to automatically reboot into the compiled kernel. If you do not want the tool to automatically perform this sensitive operation, omit this option. However, you need to manually reboot and perform the second phase (--pgo_phase 2).

      Note: All paths must be absolute paths.

      Note: The kernel of openEuler 23.09 does not support full PGO. Change the value of pgo_mode to arc.

      Compatibility

      This section describes the compatibility issues in some special scenarios. This project is in continuous iteration and issues will be fixed as soon as possible. Developers are welcome to join this project.

      • The kernel of openEuler 23.09 does not support full PGO. Change the value of pgo_mode to arc.

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份