A processor core mapping management method under a partitioned multi-core operating system
By configuring the enable state of the processor's physical cores and establishing the mapping relationship between logical cores and physical cores in the system-mode kernel, the management problem of multi-partition operating systems on multi-core platforms is solved, and multi-core parallel execution and performance improvement within partitions are realized.
Patent Information
- Application Number
- CN202111052056.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-08
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-09-08
AI Technical Summary
Existing multi-partition operating systems cannot effectively manage and configure the processor cores within a partition after upgrading from a single-core processor platform to a multi-core processor platform, resulting in the inability to perform multi-core parallel execution.
Configure the enable state of the processor's physical cores in the system-mode kernel, establish the mapping relationship between logical cores and physical cores, manage the processor cores in multiple partitions through the core mapping table, provide logical core information, and support multi-core startup and parallel execution of partitions.
It enables flexible management and parallel scheduling of multiple partitions on a multi-core processor platform, improving the execution performance of applications within the partitions.
Smart Images

Figure CN113867906B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer system software, in particular to a processor core mapping management method under a partitioned multi-core operating system. BACKGROUND
[0002] The rapid development of integrated and modular systems promotes the wider use of multi-partition operating systems that meet the requirements of integration. With the widespread use of multi-core processors, multi-partition operating systems also need to be continuously improved to adapt to multi-core platforms to meet the requirements of integrated system performance improvement.
[0003] The multi-partition operating system adapted to the single-core processing platform only has the ability to call and run on one processor core without the need for processor core management and configuration.
[0004] However, when the processor platform is upgraded to a multi-core platform, the multi-partition operating system needs to provide configuration, mapping, and management support for the processor cores within the partition, otherwise the multi-core parallel execution of processes within the partition cannot be performed. SUMMARY
[0005] Therefore, the present disclosure provides a processor core mapping management method under a partitioned multi-core operating system, which is mainly applied to a partitioned multi-core operating system that supports multiple processor cores (more than one processor core) and runs in SMP mode. The operating system provides multi-core support for partitions running on the operating system by managing physical cores and provides logical core mapping information for partitions based on the configuration to build the mapping relationship between physical cores and logical cores, thereby supporting the multi-core startup of partitions and the parallel execution of processes within the partitions.
[0006] To achieve the above purpose, the present disclosure provides the following technical solutions:
[0007] A processor core mapping management method under a partitioned multi-core operating system, comprising: configuring a specified processor physical core number of a partitioned multi-core operating system enabled in a system kernel, and using a bit definition to represent the configured processor core information, establishing a bit set flag of the enabled state of the processor core to identify the core enabled state of the current system;
[0008] Configuring the corresponding relationship between the self-defined logical core number and the processor physical core number within the specified partition before the partition runs, defining the size of the core mapping table according to the maximum number of processor cores supported by the processor platform, and configuring the corresponding physical core number with the logical core number as the index.
[0009] Further, the partitioned multi-core operating system can manage multiple partitions, and for each partition participating in scheduling, independent processor core configuration and core number mapping management information are established.
[0010] Further, the partitioned multi-core operating system saves the generated core number mapping management information to the shared data space of the system state kernel, and the core information is shared between the system state kernel and the partition.
[0011] Further, the partition starts execution from the default logical master core, reads the shared core management information to start the slave core, and notifies the master core of the start state through the logical core enable identification bit set, so that the initial synchronization of the process scheduling between the logical cores is realized.
[0012] Further, the flag bit set of the processor core process scheduling state enablement is established in the partition, and whether the logical core participates in the parallel scheduling of the processes in the partition is controlled by changing the flag bit state corresponding to the core.
[0013] Further, the physical core numbers configured in different partitions can be repeated, and the physical core numbers in the same partition are not allowed to appear repeatedly.
[0014] Further, the shared core information provides the logical core information acquisition and the logical core and physical core information conversion function for the partition.
[0015] The application provides a processor core mapping management method under a partitioned multi-core operating system, which is mainly applied to a partitioned multi-core operating system; the method comprises the following steps: on a multi-core processing platform, each application partition can configure multiple processor cores to participate in the process scheduling in the partition; the physical core management capability is realized by using the processor core bit set in the system state kernel, and the mapping relationship table of the logical core and the physical core in the partition is established according to the logical core configuration of each partition, and the core information is shared between the system state kernel and the partition, so that the processor core information management support capability is provided for the parallel execution of the processes in the partition; and through the setting of the logical core scheduling enablement state flag in the partition, the processor core is allowed or prohibited to participate in the process scheduling in the partition, so that the multi-core parallel scheduling of the processes in the partition is more flexible.
[0016] The application realizes the processor physical core management and the management capability of the logical core in the partitioned multi-core operating system, the core number management in the mutually independent partition does not affect the multi-core operation of other partitions, provides the multi-core synchronous start and the multi-core parallel scheduling support of the processes in the partition, and thus the execution performance of the application in the partition is provided. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0018] Figure 1This is a schematic diagram of logical core mapping management within a partition in an embodiment of the present invention;
[0019] Figure 2 This is a flowchart illustrating the process of establishing a logical core mapping within a partition in an embodiment of the present invention. Detailed Implementation
[0020] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0021] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0022] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.
[0023] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0024] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0025] This disclosure provides a processor core mapping management method under a partitioned multi-core operating system, including configuring the physical core number of the processor enabled by the specified partitioned multi-core operating system in the system-mode kernel, using bit definitions to represent the configured processor core information, establishing a bit set flag of the processor core's enable state, and identifying the current system's core enable state.
[0026] Before running the partition, configure the correspondence between the custom logical core number of the processor core and the physical core number of the processor in the specified partition. Define the size of the core mapping table according to the maximum number of processor cores supported by the processor platform, and configure the corresponding physical core number with the logical core number as the index.
[0027] In this embodiment of the invention, the system-state kernel of the partitioned multi-core operating system runs in SMP mode on the multi-core processing platform. The system-state kernel is configured with the physical core number enabled by the specified operating system, and a bit set definition is used to represent the processor core to be started. At the same time, the operating system maintains a bit set flag representing the enable status of the physical core.
[0028] Before partitioning, the mapping between logical core numbers and physical core numbers of processors that can run within a specified partition is configured. During configuration, the size of the mapping table is defined based on the maximum number of processor cores supported by the system, and the corresponding physical core number is configured using the logical core number as an index, thereby determining the physical core information corresponding to the logical core of each partition. The configuration process must ensure that logical core 0 must have a corresponding physical core. At runtime, a logical bit set is established for each partition to represent the enabled core information within the partition.
[0029] A partitioned multi-core operating system can manage multiple partitions. For each partition involved in scheduling, it establishes independent processor core configurations and mapping management information. Its logical core definition starts from 0 and can reach the maximum supported capacity of the processing platform. Physical core numbers configured within different partitions can be repeated, but physical core numbers within the same partition cannot appear repeatedly.
[0030] The partitioned multi-core operating system saves the generated core number mapping management data information to the shared data space of the system kernel, and shares the kernel information between the system kernel and the partition, providing support for the acquisition of logical kernel information within the partition and the mutual conversion between logical kernel information and physical kernel information.
[0031] When a partition boots up, execution begins with the default logical core 0. It reads the partition's core management information from the shared data space. After logical core 0 completes partition initialization, it starts other logical cores configured within the partition based on the partition's core mapping information. Logical core 0 must wait for the other logical cores to finish booting. Upon successful boot, each logical core sets the corresponding enable bit in the partition's logical core enable flag to a valid 1, indicating successful boot. Once all cores are ready, parallel scheduling is performed, achieving initial synchronization of process scheduling among the logical cores.
[0032] In addition to using core mapping information, a status flag for the enabled processor cores within the partition needs to be established to reflect the startup status of the logical cores within the partition; a set of flag bits for whether the processor core participates in process scheduling needs to be established, thereby providing the ability to control whether the logical core participates in the parallel scheduling and execution of processes within the partition by changing the corresponding bit flags of the core.
[0033] Next, please refer to the appendix. Figures 1-2 The present invention will be further described below.
[0034] Figure 1 This is a schematic diagram of logical core mapping management within a partition, refer to... Figure 1 The operating system configures the physical cores for system startup and establishes bit set flags. It also configures the logical core numbers of the processors managed and used within the partition, as well as their mapped physical core numbers. Based on this configuration, the operating system establishes processor core information, which is part of the partition management data. This includes the partition's logical core set, physical core set, and a mapping table between logical and physical cores. The size of the mapping table depends on the maximum number of physical cores supported by the system. When establishing the mapping table, if a logical core is configured with a corresponding physical core, it is set to the corresponding physical core number; otherwise, it is set to a special value to indicate that the logical core is not mapped to a physical core. After this table is established, it is saved to the shared space between the system and the partition, providing core number management information data support for the management of logical cores within the partition during partition startup and operation.
[0035] The partition starts on the logical 0 core first. This startup process is implemented by the operating system starting the physical core corresponding to the logical 0 core. After the logical 0 core is started, it notifies the operating system to release the startup execution of other logical cores. The operating system within the partition completes the initialization of the partition and the parallel execution of processes according to the shared core mapping information. During the process execution, the parallel scheduling of multiple cores will be completed according to the startup logical core information.
[0036] Figure 2 A flowchart for mapping logical cores within a partition, such as... Figure 2 As shown, the method for managing logical core mapping within a partition provided by this invention is as follows:
[0037] Step 1: Configure the mapping relationship between logical cores and physical cores in the entire system partition. Determine the size of the mapping table based on the maximum number of processor cores supported by the system, establish the valid physical core number corresponding to the logical core, and generate a configured core mapping table for each partition.
[0038] Step 2: The operating system starts up, executes the system-mode kernel, and establishes physical kernel management information according to the configuration.
[0039] Step 3: Create partitions in a loop according to the configuration. While creating partitions, add a physical core and logical core mapping table for each partition and save it to the shared data space between the system kernel and the partition.
[0040] Step 4: When the partition starts scheduling, the partition's first execution will start the partition operating system. According to the partition's configuration core information, logical core 0 will complete the initialization of the partition operating system and start other configured logical cores.
[0041] Step 5: Logic core 0 waits for other logic cores to be ready to start. At this time, the enabled logic cores set the enable flag and the scheduling enable flag. After the synchronization of all configured cores is completed, the processes in the partition begin to be scheduled in parallel based on all the started logic cores.
[0042] Step 6: During parallel process scheduling, you can disable logical cores from participating in process scheduling by changing the scheduling enable flag corresponding to the core number to 0, or enable logical cores to participate in scheduling by setting it to 1.
[0043] Step 7: Repeat step 4 for the first execution of the next scheduled partition.
[0044] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A method for processor core mapping management under a partitioned multi-core operating system, characterized in that, include: Configure the physical core number of the processor that the multi-core operating system of the specified partition is enabled in the system-mode kernel, and use bit definitions to represent the configured processor core information, establish a bit set flag for the enable state of the processor core, and identify the current core enable state of the system. Before partitioning, configure the correspondence between the custom logical core number of the processor core and the physical core number of the processor in the specified partition. Define the size of the core mapping table according to the maximum number of processor cores supported by the processor platform, and configure the corresponding physical core number with the logical core number as the index. The partitioned multi-core operating system can manage multiple partitions and establish independent processor core configuration and core number mapping management information for each partition participating in scheduling. It also includes that the partitioned multi-core operating system saves the generated core number mapping management information to the shared data space of the system kernel, which is shared between the system kernel and the partition. Partition startup begins with the default logical master core, reads shared core management information to start the slave cores, and notifies the master core of the startup status through the logical core enable flag bit set, thereby achieving initial synchronization of process scheduling between logical cores; A set of flags enabling the processor core process scheduling status is established within the partition, and the logical core is controlled to participate in parallel process scheduling within the partition by changing the flag status of the corresponding core.
2. The processor core mapping management method under a partitioned multi-core operating system according to claim 1, characterized in that, Physical core numbers configured in different partitions can be repeated, but physical core numbers in the same partition are not allowed to appear repeatedly.
3. The processor core mapping management method under a partitioned multi-core operating system according to claim 1, characterized in that, The shared kernel information provides functions for obtaining logical kernel information and converting logical kernel and physical kernel information within the partition.
Citation Information
Patent Citations
Configurable multi-main-mode multi-OS-inner-core real-time operating system structure and starting method
CN103793255A