LTS

    Innovation Version

      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 22.03 LTS SP2

      Hardware Requirements

      • Architecture: AArch64 or x86_64

      Software Installation

      Downloading the Kernel Source Code

      yum install -y kernel-source
      cp -r /usr/src/linux-5.10.0-153.12.0.89.oe2203sp2.aarch64 .
      

      Note: Change the version number as required.

      (Optional) Installing GCC

      GCC of openEuler 22.03 LTS SP2 can compile kernels with PGO. Alternatively, you can perform the following steps to manually build a customized GCC based on other GCC versions (GCC 10 or later). The key is to add --disable-tls --disable-libsanitizer during configuration.

      cd ${GCC_DIR}
      mkdir build
      cd build
      ../configure --prefix=${GCC_INSTALL_PREFIX} --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin --enable-initfini-array --disable-libgcj --without-isl --without-cloog --enable-gnu-indirect-function --build=aarch64-linux-gnu --with-stage1-ldflags='-Wl,-z,relro,-z,now' --with-boot-ldflags='-Wl,-z,relro,-z,now' --disable-bootstrap --with-multilib-list=lp64 --enable-bolt --disable-tls --disable-libsanitizer
      make -j 96 && make install -j 96
      

      Installing A-FOT

      git clone https://gitee.com/openeuler/A-FOT.git
      

      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 GCOV or full PGO.all
      4pgo_phaseFDO execution 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

      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).

      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 implementation of FDO in the GCC varies with the version. Therefore, GCC 10 or later is required.

      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备份