CN-115686885-B - Low-speed io synergy method for Linux kernel
Abstract
The invention relates to a method for enhancing low-speed io of a Linux kernel, which comprises the following steps of installing jailhouse tools, carrying out cell configuration, initializing Linux application, running an iodemo. According to the method for enhancing the low-speed io of the Linux kernel, provided by the invention, the i2c program (iodemo. Bin) can be independently operated through the jailhouse tool, and the data interaction is carried out with the Linux in a memory sharing mode, so that the io density of the Linux is greatly reduced, the cpu density is enhanced, and the real-time performance and efficiency of the kernel are improved.
Inventors
- ZHANG YOUJING
- GAO CHENGBO
- CUI YANZHAO
- QI XUAN
- Zhan mao
Assignees
- 麒麟软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221101
Claims (3)
- 1. The method for enhancing the low-speed io of the Linux kernel is characterized by comprising the following steps of: Step S1, installing jailhouse tools; Step S2, performing cell configuration, and setting the address, the size and the console of the virtualized firmware; step S3, initializing Linux application; step S4, running the iodemo. Step S5, data transmission and reception are carried out, and the Linux application carries out data transmission and reception on the i2c equipment through the bare metal program Iodemo. The step S2 comprises isolating the last CPU, increasing the linked address space and mapping of the iodemo. Bin, and increasing the i2c device and shared memory operation space, wherein the isolated last CPU is determined by cpumask structures in the linux kernel, and the CPU corresponding to the lowest bit mask is the last CPU; The step S3 includes that linux runs an elf program app-io, the program firstly initializes a shared memory configuration area, configures i2c transmission time sequence according to the actual situation of i2c equipment, decides whether to transmit and receive shared memory data based on data frames or byte streams, defines depth information of a transmitting queue and a receiving queue, and configures a clear transmitting and receiving queue.
- 2. The method of low-speed io synergy of Linux kernel of claim 1 wherein when installing jailhouse tool, static partition environment is built, the machine is configured by enabling hardware to support virtualized extension and more than two CPU cores, linux kernel version 4.7 or more is used for supporting arm64 virtualized control mechanism, PSCI support for CPU operation is used for providing power state control interface in a firmware mode for supporting CPU offline operation.
- 3. The method of low speed io synergy of the Linux kernel of claim 1 wherein step S4 comprises initializing jailhouse and running iodemo. Bin via jailhouse enable, CELL CREATE, cell load and CELL START commands of jailhouse.
Description
Low-speed io synergy method for Linux kernel Technical Field The invention relates to the technical field of performance optimization of an operating system, in particular to a method for low-speed io synergy of a Linux kernel. Background Linux, which is a monolithic macro kernel, has high running performance, but there may be some codes due to the driver or kernel, because the low running efficiency of the system occurs due to the io device waiting for low speed, and the io synergy is very important. In some Linux operating environments, even without i2c hardware, simulating the timing of i2c by gpio in the kernel is an extremely inefficient matter. In kernel I/O technology, some people currently use synchronous io technology, and when blocking occurs, scheduling can be performed by means of sleep processes. Therefore, the linux scheduler also introduces non-real-time performance, and reduces the operation efficiency of the system if the number of threads is not reasonable. Related personnel use asynchronous notification technology to develop, but the mode needs to rely on the design of bottom dmas, fifo and the like, the support of the hardware mechanism is limited, and fifo overflow and the like can be generated if the hardware configuration is not satisfied or the setting is unreasonable, so that overtime or loss of data is caused. And technicians directly simulate the time sequence of the i2c equipment in the kernel, so that the linux operation efficiency is greatly reduced. Disclosure of Invention In order to solve the defects existing in the prior art, the invention provides a method for low-speed io synergy of a Linux kernel, which comprises the following steps: Step S1, installing jailhouse tools; Step S2, performing cell configuration, and setting the address, the size and the console of the virtualized firmware; step S3, initializing Linux application; step S4, running the iodemo. And S5, carrying out data transmission and reception, wherein the Linux application carries out data transmission and reception on the i2c device through the bare metal program Iodemo. When a jailhouse tool is installed, the static partition environment is built, and the machine is configured by enabling hardware to support virtualized expansion and two or more CPU cores, enabling a Linux kernel to be more than 4.7 versions, and enabling a control mechanism for supporting arm64 virtualization to support PSCI (power state control) of CPU operation, and providing a power state control interface in a firmware mode for supporting CPU offline operation. The step S2 includes isolating the last cpu, adding the linked address space and mapping of iodemo. Bin, adding the i2c device and the shared memory operation space, wherein the isolated last cpu is determined by cpumask structures in the linux kernel, and the cpu corresponding to the lowest bit mask is the last cpu. The step S3 includes that linux runs an elf program app-io, the program firstly initializes a shared memory configuration area, configures i2c transmission time sequence according to the actual situation of i2c equipment, decides whether to transmit and receive shared memory data based on data frames or byte streams, defines depth information of a transmitting queue and a receiving queue, and configures a clear transmitting and receiving queue. The step S4 includes performing jailhouse initialization and running iodemo. Bin through jailhouse enable, CELL CREATE, cell load and CELL START commands of jailhouse. According to the method for enhancing the low-speed io of the Linux kernel, provided by the invention, the i2c program (iodemo. Bin) can be independently operated through the jailhouse tool, and the data interaction is carried out with the Linux in a memory sharing mode, so that the io density of the Linux is greatly reduced, the cpu density is enhanced, and the real-time performance and efficiency of the kernel are improved. Drawings FIG. 1 is a diagram of a logical framework implemented by the method for low-speed io synergy of the Linux kernel of the invention. Detailed Description In order to further understand the technical scheme and beneficial effects of the present invention, the technical scheme and beneficial effects thereof will be described in detail with reference to the accompanying drawings. Referring to fig. 1, a logic frame diagram is implemented for the Linux kernel low-speed io synergy method of the present invention, by enabling a low-speed i2c device of a Linux system to work on a CPU running in parallel and independently, so as to promote real-time performance of the Linux system, a binary program running on a CPU can interact with the Linux through a shared memory, support fifo depth configuration, support advanced settings, such as data parsing, data framing, etc., and further promote the io efficiency of the Linux. Wherein the shared memory is divided into a configuration area, a transmission area and a reception area (i.e., a transm