CN110928687B - CPU resource allocation method and test equipment - Google Patents

CPU resource allocation method and test equipment Download PDF

Info

Publication number
CN110928687B
CN110928687B CN201911166963.8A CN201911166963A CN110928687B CN 110928687 B CN110928687 B CN 110928687B CN 201911166963 A CN201911166963 A CN 201911166963A CN 110928687 B CN110928687 B CN 110928687B
Authority
CN
China
Prior art keywords
test
core
cpu
resource scheduling
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911166963.8A
Other languages
Chinese (zh)
Other versions
CN110928687A (en
Inventor
宋涛
刘玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201911166963.8A priority Critical patent/CN110928687B/en
Publication of CN110928687A publication Critical patent/CN110928687A/en
Application granted granted Critical
Publication of CN110928687B publication Critical patent/CN110928687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application provides a CPU resource allocation method and test equipment. The test equipment comprises a test process and a resource scheduling platform, wherein the test process is used for executing a test task, the test process comprises a plurality of test threads, the test equipment comprises at least one CPU, each CPU comprises at least one Core, the test process sends a resource scheduling request to the resource scheduling platform, and the resource scheduling request comprises CPU resource information required by executing the test task; the resource scheduling platform allocates at least one target Core for the test process according to CPU resource information required by executing the test task; the resource scheduling platform sends a resource scheduling response to the test process, wherein the resource scheduling response comprises at least one identification of a target Core; the test process allocates a plurality of test threads to each target Core. The method and the device for testing the CPU resource of the test equipment are distributed by taking the Core as a basic unit, so that the CPU resource of the test equipment can be reasonably utilized.

Description

CPU resource allocation method and test equipment
Technical Field
The present disclosure relates to the field of network communications technologies, and in particular, to a method and a test device for allocating CPU resources.
Background
A network tester (hereinafter referred to as a test device) is mainly used for testing network performance of a device under test. Such as whether a connection can be established, the number of connections that can be established, etc.
Test equipment typically includes a plurality of multi-Core Processors (CPUs) and a plurality of physical ports. In order to avoid performance jitter caused by preempting CPU resources for each test service, the CPU is typically bound to a physical port. In this way, test traffic transmitted through the physical port will be handled by the CPU bound to the physical port.
However, the complexity of each test service is different, resulting in a difference in the processing pressure of the CPU that processes the test service. For example, a CPU that handles complex test traffic may be overloaded, while a CPU that handles simple test traffic may be idle, resulting in unreasonable CPU resource utilization by the test equipment.
Disclosure of Invention
In view of this, the present application proposes a method for allocating CPU resources and a test apparatus for reasonably utilizing the CPU resources of the test apparatus.
In order to achieve the purposes of the application, the application provides the following technical scheme:
in a first aspect, the present application provides a method for allocating resources of a CPU, applied to a test device, where the test device includes a test process and a resource scheduling platform, the test process is used for executing a test task, the test process includes a plurality of test threads, the test device includes at least one CPU, each CPU includes at least one Core, and the method includes:
the test process sends a resource scheduling request to the resource scheduling platform, wherein the resource scheduling request comprises CPU resource information required by executing the test task;
the resource scheduling platform allocates at least one target Core for the test process according to the CPU resource information required by executing the test task;
the resource scheduling platform sends a resource scheduling response to the test process, wherein the resource scheduling response comprises the identification of the at least one target Core;
the test process allocates the plurality of test threads to respective target cores.
Optionally, before the test process sends a resource scheduling request to the resource scheduling platform, the method further includes:
the test process receives a test configuration instruction, wherein the test configuration instruction comprises a test specification of the test task;
and the test process searches the required CPU resource information corresponding to the test specification of the test task from the corresponding relation between each preset test specification and the CPU resource information required by executing the test task of the test specification.
Optionally, the resource scheduling response further includes a Core type of the at least one target Core, the Core type being used to characterize a processing capability of the Core, and the test process allocating the plurality of test threads to each target Core, including:
and the test process distributes the plurality of test threads to each target Core according to the load condition of the test task borne by each test thread and the Core type of each target Core.
Optionally, before the resource scheduling platform sends a resource scheduling response to the test process, the method further includes:
the resource scheduling platform acquires the CPU type of each CPU aiming at each CPU;
searching the Core type corresponding to the CPU type of the CPU from the corresponding relation between the preset CPU type and the Core type;
the found Core type is determined as the Core type of all cores included in the CPU.
Optionally, the method further comprises:
the resource scheduling platform divides each Core included by the at least one CPU into a system special Core, a public Core and a test special Core;
the at least one target Core allocated by the resource scheduling platform for the test process comprises a public Core and/or a test private Core;
the test process allocates the plurality of test threads to each target Core, including:
and the test process distributes each test thread to a public Core and/or a special Core for testing according to the type of the test task carried by each test thread.
In a second aspect, the present application provides a test apparatus, the test apparatus comprising a test process and a resource scheduling platform, the test process being for performing a test task, the test process comprising a plurality of test threads, the test apparatus comprising at least one CPU, each CPU comprising at least one Core;
the test process is used for sending a resource scheduling request to the resource scheduling platform, wherein the resource scheduling request comprises CPU resource information required by executing the test task; distributing the plurality of test threads to at least one target Core distributed to the resource scheduling platform;
the resource scheduling platform is used for distributing at least one target Core for the test process according to the CPU resource information required by executing the test task; and sending a resource scheduling response to the test process, wherein the resource scheduling response comprises the identification of the at least one target Core.
Optionally, the test process is further configured to receive a test configuration instruction, where the test configuration instruction includes a test specification of the test task; searching the required CPU resource information corresponding to the test specification of the test task from the corresponding relation between each preset test specification and the CPU resource information required by executing the test task of the test specification.
Optionally, the resource scheduling response further includes a Core type of the at least one target Core, the Core type being used to characterize the processing capability of the Core;
the test process is specifically configured to allocate the plurality of test threads to each target Core according to the load condition of the test task carried by each test thread and the Core type of each target Core.
Optionally, the resource scheduling platform is further configured to obtain, for each CPU, a CPU type of the CPU; searching the Core type corresponding to the CPU type of the CPU from the corresponding relation between the preset CPU type and the Core type; the found Core type is determined as the Core type of all cores included in the CPU.
Optionally, the resource scheduling platform is further configured to divide each Core included in the at least one CPU into a system-specific Core, a public Core, and a test-specific Core;
the at least one target Core allocated by the resource scheduling platform for the test process comprises a public Core and/or a test private Core;
the test process is specifically configured to allocate each test thread to a public Core and/or a test dedicated Core according to a type of a test task carried by each test thread.
As can be seen from the above description, in the present application, the resource scheduling platform allocates CPU resources for the test process based on the request of the test process, and allocates the CPU resources with Core as a basic unit, so that the CPU resources of the test device can be more reasonably utilized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for allocating CPU resources according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating an implementation of determining CPU resource information required to perform a test task according to an embodiment of the present application;
FIG. 3 is an implementation flow of a Core type determination for each Core in a test device, as shown in an embodiment of the present application;
FIG. 4 is an internal block diagram of a test apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a test apparatus according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the negotiation information may also be referred to as second information, and similarly, the second information may also be referred to as negotiation information, without departing from the scope of embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The embodiment of the application provides a CPU resource allocation method. In the method, the resource scheduling platform allocates the CPU resource for the test process based on the request of the test process and allocates the CPU resource by taking the Core as a basic unit, so that the CPU resource utilization of the test equipment can be more reasonable.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of the embodiments of the present application is performed in conjunction with the accompanying drawings and specific embodiments:
referring to fig. 1, a flowchart of a method for allocating CPU resources is shown in an embodiment of the present application. The flow is applied to the test equipment. The test equipment comprises a test process and a resource scheduling platform.
The test process is used for executing specific test tasks, such as testing the message processing capability of the tested device. The resource scheduling platform is used for distributing CPU resources for the test process.
It should be noted that the test apparatus includes at least one CPU, and each CPU includes at least one Core. The test process includes a plurality of test threads. The embodiment of the application needs to allocate CPU resources for each test thread.
As shown in fig. 1, the process may include the steps of:
step 101, a test process sends a resource scheduling request to a resource scheduling platform.
In the embodiment of the application, before executing a specific test task, the test process needs to apply for CPU resources to the resource scheduling platform. For this purpose, the test process sends a resource scheduling request to the resource scheduling platform, the resource scheduling request including CPU resource information required by the test process to execute the test task.
Step 102, the resource scheduling platform allocates at least one target Core for the test process according to the CPU resource information required by the test process to execute the test task.
The resource scheduling platform receives a resource scheduling request sent by a test process through step 101, acquires CPU resource information required by the test process to execute a test task, and allocates CPU resources for the test process according to the CPU resource information.
As one embodiment, the CPU resource information required by the test process to perform the test task includes the number of cores required by the test process to perform the test task. And the resource scheduling platform allocates at least the target cores for the test process according to the number of cores required by the test process to execute the test task. For example, the test process needs 2 cores to execute the test task, and the resource scheduling platform allocates at least 2 target cores to the test process.
As another example, the CPU resource information required by the test process to perform a test task may include the number of cores required as well as the Core type. Wherein the Core type is used to characterize the processing capacity of the Core. The resource scheduling platform allocates the target cores matched with the Core types of the number of the Core types for the test process according to the number of the needed cores and the Core types. For example, the test process needs 2 cores to execute the test task, and at least one Core is required to be a Core with high processing capability, the resource scheduling platform may select at least 2 target cores for the test process, and ensure that at least one target Core is a Core with high processing capability.
The Core allocated by the resource scheduling platform for the test process is referred to herein as the target Core. It will be appreciated that the term target Core is used for descriptive purposes only and is not intended to be limiting.
And step 103, the resource scheduling platform sends a resource scheduling response to the test process.
After the resource scheduling platform allocates the target Core to the test process through step 102, a resource scheduling response is sent to the test process, where the resource scheduling response includes an identifier of at least one target Core allocated by the resource scheduling platform to the test process.
In step 104, the test process allocates a plurality of test threads to each target Core.
The test process receives the resource scheduling response sent by the resource scheduling platform through step 103, and obtains the identification of at least one target Core included in the resource scheduling response.
And the test process distributes a plurality of test threads included by the test process to each target Core according to the identification of the at least one target Core so as to execute the test task.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in the embodiment of the present application, the resource scheduling platform allocates CPU resources for the test process based on the request of the test process, and allocates the CPU resources with Core as a basic unit, so that the CPU resources of the test device can be more reasonably utilized.
As an embodiment, the test process may further execute the following implementation procedure to determine CPU resource information required to execute the test task before executing step 101. Referring to fig. 2, a process for determining CPU resource information required for performing a test task is shown in an embodiment of the present application.
As shown in fig. 2, the process may include the steps of:
in step 201, a test process receives a test configuration instruction.
The test configuration instruction includes a test specification of a test task to be performed. For example, the test rule of the current test task is to send 100M traffic to the device under test.
Step 202, the test process searches the required CPU resource information corresponding to the test specification of the test task to be executed from the corresponding relation between each preset test specification and the CPU resource information required for executing the test task of the test specification.
The hardware resources of the test equipment are fixed, such as the type of CPU, the processing power of the Core in the CPU, etc. Therefore, the CPU resources required by executing the test tasks of each test specification can be estimated according to the processing capacity of the CPU and are pre-configured in the test equipment. Referring to table 1, an example of correspondence between each test specification and CPU resource information required to perform a test task of the test specification is shown as an embodiment of the present application.
Test specification CPU resource information required
100M flow rate 2 cores
200M flow 4 cores
…… ……
TABLE 1
Here, when the processing capability of each Core in the test apparatus is different, a desired Core type may be specified in the desired CPU resource information. As previously mentioned, this Core type is used to characterize the processing capacity of the Core. Referring to table 2, another example of correspondence between each test specification and CPU resource information required to perform a test task of the test specification is shown as an embodiment of the present application.
TABLE 2
Taking the 1 st correspondence in table 2 as an example, the correspondence represents: when the test specification is 100M flow, the test process needs 2 cores to execute the test task of the test specification, wherein at least 1 big Core is needed. Here, the large Core represents a Core type, which is used to represent a Core with a high processing capacity.
In this step, the test process searches for the required CPU resource information corresponding to the test specification of the test task to be executed from the corresponding relationship (e.g., table 1 or table 2) between each preset test specification and the CPU resource information required for executing the test task of the test specification.
Thus, the flow shown in fig. 2 is completed.
As can be seen from the flow shown in fig. 2, in the embodiment of the present application, the test process may automatically confirm the required CPU resources according to the test rule of the test task.
As an embodiment, when the test process receives the resource scheduling response through step 103 and the resource scheduling response includes the Core type of the target Core, the test process performs the specific step of step 104, that is, a plurality of test threads are allocated to each target Core according to the load condition of the test task carried by each test thread and the Core type of each target Core.
For example, the resource scheduling platform allocates two target cores for the test process, namely Core1 and Core2, wherein the Core type of Core1 is a large Core and represents a Core with higher processing capacity; core type Core2 is a small Core, representing a Core with weaker handling capacity. The test process comprises two test threads, namely a test thread 1 and a test thread 2, wherein the load of the test task borne by the test thread 1 is larger, and the load of the test task borne by the test thread 2 is smaller. The test process may assign test thread 1 to Core1 with greater processing power and test thread 2 to Core2 with less processing power.
Thus, the description of the present embodiment is completed. From the above description, it can be seen that the resource allocation is performed based on the Core processing capability and the load condition of the test task carried by the test thread, so that the CPU resource utilization is more reasonable.
As an embodiment, the resource scheduling platform may further perform the following process flow of determining the Core type of each Core in the test equipment before performing step 103 to send the resource scheduling response to the test process. Referring to fig. 3, an implementation flow for determining Core types of cores in a test apparatus is shown in an embodiment of the present application.
As shown in fig. 3, the process may include the steps of:
in step 301, the resource scheduling platform acquires, for each CPU, a CPU type of the CPU.
In this embodiment, after the resource scheduling platform is started, each CPU may be scanned. The CPU type of each CPU is acquired by scanning, for example, the CPU type of the current CPU is AMD Ryzen3900 x.
Step 302, the resource scheduling platform searches for the Core type corresponding to the CPU type of the CPU from the preset correspondence between the CPU type and the Core type.
The type of CPU used by the test equipment is known, for example, 5 types of CPUs are used by the current test equipment, namely XEON E5-2690 v3, XEON Gold 6146, i7-7900x, XEONPlatinum8176 and AMD Ryzen3900 x.
In the embodiment of the application, performance tests can be performed on various types of CPUs used by the test equipment. Specifically, the processing performance of a single Core in each type of CPU was tested.
For example, after testing, the handling performance of a single Core in XEON E5-2690 v3 was defined as 100%; the processing performance of a single Core in the XEON Gold 6146 can reach 120 percent relative to the processing performance of a single Core in the XEON E5-2690 v 3; the processing performance of a single Core in i7-7900x can reach 140% relative to the processing performance of a single Core in XEON E5-2690 v 3; the processing performance of the single Core in the XEONPlatinum8176 can reach 160% relative to the processing performance of the single Core in the XEON E5-2690 v 3; the handling performance of individual cores in AMD Ryzen3900x may reach 170% relative to the handling performance of individual cores in XEON E5-2690 v3.
As one example, 150% may be defined as a boundary, a Core with a handling performance less than 150% may be defined as a small Core, and a Core with a handling performance greater than or equal to 150% may be defined as a large Core. I.e. the processing power of the Core is differentiated by the large Core, the small Core.
The embodiment of the application can preset the corresponding relation between each CPU type and Core type, as shown in table 3.
TABLE 3 Table 3
When the resource scheduling platform obtains the CPU type of the currently scanned CPU through step 301, the Core type corresponding to the CPU type of the CPU may be searched from the preset correspondence between the CPU type and the Core type according to the CPU type of the CPU.
For example, the resource scheduling platform scans to the first CPU, denoted CPU1, via step 301. The CPU type of the CPU1 is XEON E5-2690 v3. The resource scheduling platform searches the table 3 according to XEON E5-2690 v3, hits the 1 st table entry, and acquires the Core type (corelet) included in the table entry.
In step 303, the resource scheduling platform determines the Core type found as the Core type of all cores included in the CPU.
The processing performance of each Core in the same CPU is the same, so the Core type found in step 302 is the Core type of all cores included in the current CPU.
Taking the foregoing CPU1 as an example, if the Core type obtained by looking up table 3 is a corelet, it can be determined that the Core type of all cores included in the CPU1 is a corelet.
Similarly, the resource scheduling platform may obtain Core types for all cores in the test equipment.
Based on this, the resource scheduling platform may include the Core type of each target Core in the resource scheduling response when executing step 103, such that the test process allocates a plurality of test threads into each target Core based on the Core type of each target Core.
Thus, the flow shown in fig. 3 is completed.
Through the flow shown in fig. 3, the resource scheduling platform can obtain Core types of all cores in the test equipment.
As one example, the resource scheduling platform may divide individual cores in the test equipment into a system specific Core, a utility Core, and a test specific Core. Wherein the system specific Core may be provided for operating system (e.g., linux operating system) specific; the common Core may be provided common to all test processes; the test specific Core may be provided to be specific to the test process. For example, the test equipment has 10 cores, denoted as cores 1-10, and the resource scheduling platform may divide cores 1, 2 into system-specific cores, divide cores 3, 4 into utility cores, and divide cores 5-10 into test-specific cores.
Based on this, the resource scheduling platform may include a common Core and/or a test-specific Core when assigning at least one target Core for the test process. The test process selects a public Core and/or a special Core for each test thread according to the type of the test task carried by each test thread.
As an example, if the test process includes test threads that do not have high processing performance requirements, then the test process applies for a common Core to the resource scheduling platform, via step 101. The resource scheduling platform assigns a common Core to the test process, via step 102, and sends it to the test process, via step 103. The test process assigns each test thread to its assigned common Core for the resource scheduling platform, via step 104.
As another example, where the test process includes a test thread with high processing performance requirements, the test process applies for a test-specific Core to the resource scheduling platform, via step 101. The resource scheduling platform allocates a test specific Core to the test process, via step 102, and optionally provides a common Core to the test process, and sends the common Core to the test process, via step 103. The test process allocates the test thread with higher processing performance requirement to the test dedicated Core allocated to the resource scheduling platform through step 104. If the test process further includes a test thread with low processing performance requirements, the test thread may be allocated to a common Core provided by the resource scheduling platform. So that the CPU resource utilization is more reasonable.
The CPU resource allocation method provided in the present application will now be described in detail with reference to a specific embodiment.
Referring to fig. 4, an internal structure diagram of a test apparatus is shown in an embodiment of the present application. The test equipment comprises two CPUs, namely a CPU41 and a CPU42, wherein the type of the CPU41 is AMD Ryzen3900x; the CPU42 is of the type XEON E5-2690 v3. After performance testing is performed on cores of the CPU41 and the CPU42, respectively, the correspondence relationship shown in table 4 is obtained and configured into the test apparatus.
TABLE 4 Table 4
The Linux operating system 43 is installed in the test equipment, and after the operating system is started, the resource scheduling platform 44 is automatically started. The resource scheduling platform 44 scans hardware resources in the test equipment. Taking the scan CPU41 as an example, the CPU41 is obtained by scanning for AMD Ryzen3900x, and looking up table 4 shows that the cores 401 to 406 included in the CPU41 are large cores. Similarly, by scanning the CPU42, the Core types of cores 407 to 410 included in the CPU42 are known as corelets.
The resource scheduling platform 44 may divide the cores 401 and 402 into system-specific cores, which are allocated to the Linux operating system 43 for use; core403 and Core404 are divided into a common Core for use by all test procedures; core 405-Core 410 is divided into test specific cores for exclusive use by test processes.
The test equipment shown in fig. 4 includes a test process 45 and a test process 46. Taking test procedure 45 as an example, the test procedure is used to send traffic to the device under test to test the message handling capability of the device under test. The test process 45 includes 2 assist threads (with low processing performance requirements) and 20 threads for sending messages (referred to as packet sending threads).
The user configures the test specification of the test task to be performed this time by the test process 45, for example, the test specification is to send 100M traffic. The test process 45 queries the preconfigured table 5 according to the test specification.
Test specification CPU resource information required
100M flow rate 2 cores, including at least 1 big Core
…… ……
TABLE 5
It is known that under this test specification, 2 cores are required and at least 1 large Core is included.
The test process 45 sends a resource scheduling request to the resource scheduling platform 44, the resource scheduling request including the required CPU resource information (2 cores, including at least 1 big Core) acquired by the lookup table 5.
After receiving the resource scheduling request, the resource scheduling platform 44 obtains CPU resource information (2 cores, including at least 1 big Core) required by the test process 45 included in the resource scheduling request to execute the test task. From Core 405-Core 410 (which are currently in an idle state) a test-specific Core is selected for test process 45 based on the CPU resource information. As previously described, core405, core406 is a large Core and cores 407-410 are small cores, then resource scheduling platform 44 may select Core405 and Core407 to be assigned to test process 45.
The resource scheduling platform 44 sends a resource scheduling response to the test process 45, which includes the identities of Core405 and Core407 and the corresponding Core type. In addition, the identities of Core403 and Core404 and the corresponding Core type (used to represent a common Core) may also be included in the resource scheduling response.
The test process 45 receives the resource scheduling response and obtains the identity of the Core for which the resource scheduling platform 44 is assigned and the corresponding Core type, as shown in table 6.
Core identification Core type
Core403 Public use
Core404 Public use
Core405 Big core
Core407 Micronucleus
TABLE 6
Based on the obtained information, the test process 45 may assign 2 assist threads to Core403 (common Core); distributing 12 packet-sending threads to Core405 (big Core); the 8 wrap threads are assigned to Core407 (corelet).
So far, the allocation of CPU resources for the test process is completed.
The foregoing is a description of a method provided by an embodiment of the present application, and the following describes an apparatus provided by an embodiment of the present application:
referring to fig. 5, a schematic structural diagram of an apparatus according to an embodiment of the present application is provided. The apparatus includes: a test process 501 and a resource scheduling platform 502, wherein:
the test process 501 is configured to send a resource scheduling request to the resource scheduling platform 502, where the resource scheduling request includes CPU resource information required for executing the test task; and assigning the plurality of test threads to at least one target Core for which the resource scheduling platform 502 is assigned;
the resource scheduling platform 502 is configured to allocate at least one target Core to the test process 501 according to the CPU resource information required for executing the test task; a resource scheduling response is sent to the test process 501, the resource scheduling response including an identification of the at least one target Core.
As an embodiment, the test process 501 is further configured to receive a test configuration instruction, where the test configuration instruction includes a test specification of the test task; searching the required CPU resource information corresponding to the test specification of the test task from the corresponding relation between each preset test specification and the CPU resource information required by executing the test task of the test specification.
As an embodiment, the resource scheduling response further comprises a Core type of the at least one target Core, the Core type being used to characterize the processing capabilities of the Core;
the test process 501 is specifically configured to allocate the plurality of test threads to each target Core according to the load condition of the test task carried by each test thread and the Core type of each target Core.
As an embodiment, the resource scheduling platform 502 is further configured to obtain, for each CPU, a CPU type of the CPU; searching the Core type corresponding to the CPU type of the CPU from the corresponding relation between the preset CPU type and the Core type; the found Core type is determined as the Core type of all cores included in the CPU.
As an embodiment, the resource scheduling platform 502 is further configured to divide each Core included in the at least one CPU into a system-specific Core, a public Core, and a test-specific Core;
the at least one target Core allocated by the resource scheduling platform 502 for the test process includes a public Core and/or a test-specific Core;
the test process 501 is specifically configured to allocate each test thread to a common Core and/or a test dedicated Core according to a type of a test task carried by each test thread.
The description of the apparatus shown in fig. 5 is thus completed.
The foregoing description of the preferred embodiments is merely exemplary in nature and is not intended to limit the invention to the precise form disclosed, and thus, any modification, equivalents, and alternatives falling within the spirit and scope of the embodiments are intended to be included within the scope of the invention.

Claims (8)

1. A method for allocating CPU resources of a multi-Core processor, the method being applied to a test device, the test device including a test process and a resource scheduling platform, the test process being configured to perform a test task, the test process including a plurality of test threads, the test device including at least one CPU, each CPU including at least one Core, the method comprising:
the test process sends a resource scheduling request to the resource scheduling platform, wherein the resource scheduling request comprises CPU resource information required by executing the test task;
the resource scheduling platform allocates at least one target Core for the test process according to the CPU resource information required by executing the test task;
the resource scheduling platform sends a resource scheduling response to the test process, wherein the resource scheduling response comprises the identification of the at least one target Core; the resource scheduling response further includes a Core type of the at least one target Core, the Core type being used to characterize the processing capabilities of the Core; core types of different cores in the same CPU are the same; the at least one target Core comprises target cores in different CPUs;
the test process allocates the plurality of test threads to each target Core, including: and the test process distributes the plurality of test threads to each target Core according to the load condition of the test task borne by each test thread and the Core type of each target Core.
2. The method of claim 1, wherein before the test process sends a resource scheduling request to the resource scheduling platform, the method further comprises:
the test process receives a test configuration instruction, wherein the test configuration instruction comprises a test specification of the test task;
and the test process searches the required CPU resource information corresponding to the test specification of the test task from the corresponding relation between each preset test specification and the CPU resource information required by executing the test task of the test specification.
3. The method of claim 1, wherein before the resource scheduling platform sends a resource scheduling response to the test process, the method further comprises:
the resource scheduling platform acquires the CPU type of each CPU aiming at each CPU;
searching the Core type corresponding to the CPU type of the CPU from the corresponding relation between the preset CPU type and the Core type;
the found Core type is determined as the Core type of all cores included in the CPU.
4. The method of claim 1, wherein the method further comprises:
the resource scheduling platform divides each Core included by the at least one CPU into a system special Core, a public Core and a test special Core;
the at least one target Core allocated by the resource scheduling platform for the test process comprises a public Core and/or a test private Core;
the test process allocates the plurality of test threads to each target Core, including:
and the test process distributes each test thread to a public Core and/or a special Core for testing according to the type of the test task carried by each test thread.
5. A test device, comprising a test process and a resource scheduling platform, wherein the test process is used for executing a test task, the test process comprises a plurality of test threads, the test device comprises at least one CPU, and each CPU comprises at least one Core;
the test process is used for sending a resource scheduling request to the resource scheduling platform, wherein the resource scheduling request comprises CPU resource information required by executing the test task; distributing the plurality of test threads to at least one target Core distributed to the resource scheduling platform;
the resource scheduling platform is used for distributing at least one target Core for the test process according to the CPU resource information required by executing the test task; transmitting a resource scheduling response to the test process, the resource scheduling response including an identification of the at least one target Core; the resource scheduling response further includes a Core type of the at least one target Core, the Core type being used to characterize the processing capabilities of the Core; the processing performance of different cores in the same CPU is the same, and the types of cores are the same; the at least one target Core comprises target cores in different CPUs;
the test process is specifically configured to allocate the plurality of test threads to each target Core according to the load condition of the test task carried by each test thread and the Core type of each target Core.
6. The apparatus as claimed in claim 5, wherein:
the test process is further used for receiving a test configuration instruction, and the test configuration instruction comprises a test specification of the test task; searching the required CPU resource information corresponding to the test specification of the test task from the corresponding relation between each preset test specification and the CPU resource information required by executing the test task of the test specification.
7. The apparatus as claimed in claim 5, wherein:
the resource scheduling platform is further used for acquiring the CPU type of each CPU for the CPU; searching the Core type corresponding to the CPU type of the CPU from the corresponding relation between the preset CPU type and the Core type; the found Core type is determined as the Core type of all cores included in the CPU.
8. The apparatus as claimed in claim 5, wherein:
the resource scheduling platform is further used for dividing each Core included by the at least one CPU into a system special Core, a public Core and a test special Core;
the at least one target Core allocated by the resource scheduling platform for the test process comprises a public Core and/or a test private Core;
the test process is specifically configured to allocate each test thread to a public Core and/or a test dedicated Core according to a type of a test task carried by each test thread.
CN201911166963.8A 2019-11-25 2019-11-25 CPU resource allocation method and test equipment Active CN110928687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911166963.8A CN110928687B (en) 2019-11-25 2019-11-25 CPU resource allocation method and test equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911166963.8A CN110928687B (en) 2019-11-25 2019-11-25 CPU resource allocation method and test equipment

Publications (2)

Publication Number Publication Date
CN110928687A CN110928687A (en) 2020-03-27
CN110928687B true CN110928687B (en) 2024-02-27

Family

ID=69850928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911166963.8A Active CN110928687B (en) 2019-11-25 2019-11-25 CPU resource allocation method and test equipment

Country Status (1)

Country Link
CN (1) CN110928687B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581041A (en) * 2020-05-07 2020-08-25 苏州浪潮智能科技有限公司 Method and equipment for testing performance of magnetic disk
CN114244692B (en) * 2021-04-30 2024-02-02 无锡江南计算技术研究所 Fault rapid positioning method suitable for ultra-large scale interconnection network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850480A (en) * 2015-05-18 2015-08-19 曙光信息产业(北京)有限公司 Method and device for testing performance of hard disk of high-density storage server
CN105573850A (en) * 2015-11-09 2016-05-11 广州多益网络科技有限公司 Multi-process interactive method and system and server
CN108616424A (en) * 2018-04-26 2018-10-02 新华三技术有限公司 A kind of resource regulating method, computer equipment and system
CN110347508A (en) * 2019-07-02 2019-10-18 Oppo广东移动通信有限公司 Thread distribution method, device, equipment and the readable storage medium storing program for executing of application program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI602125B (en) * 2014-04-17 2017-10-11 國立臺灣大學 Resource allocation method
CN106484537B (en) * 2016-09-30 2019-07-19 网易(杭州)网络有限公司 A kind of distribution method and equipment of CPU core resource

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850480A (en) * 2015-05-18 2015-08-19 曙光信息产业(北京)有限公司 Method and device for testing performance of hard disk of high-density storage server
CN105573850A (en) * 2015-11-09 2016-05-11 广州多益网络科技有限公司 Multi-process interactive method and system and server
CN108616424A (en) * 2018-04-26 2018-10-02 新华三技术有限公司 A kind of resource regulating method, computer equipment and system
CN110347508A (en) * 2019-07-02 2019-10-18 Oppo广东移动通信有限公司 Thread distribution method, device, equipment and the readable storage medium storing program for executing of application program

Also Published As

Publication number Publication date
CN110928687A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN108463805B (en) User equipment selection for mobile edge computing
CN106302434B (en) Server adaptation method, device and system
CN108268372B (en) Mock test processing method and device, storage medium and computer equipment
CN110928687B (en) CPU resource allocation method and test equipment
CN108012307B (en) Wireless heterogeneous network selection method, device, equipment and readable storage medium
CN108933829A (en) A kind of load-balancing method and device
CN111447155A (en) Data transmission method, device, equipment and storage medium
CN111782383A (en) Task allocation method, server, electronic terminal and computer readable storage medium
CN113938435B (en) Data transmission method, device, electronic equipment, storage medium and program product
CN111163140A (en) Method, apparatus and computer readable storage medium for resource acquisition and allocation
CN106209680B (en) Information processing apparatus and information processing method
CN107645468B (en) Extension resource allocation method and device
US20180084519A1 (en) Terminal Device Positioning Method, Positioning Server, Access Point, and System
CN107645727B (en) Method and device for testing base station
CN111737000A (en) Method for realizing load balance
RU2005141572A (en) SYSTEM AND METHOD OF GROUP LIMITED ACCESS FOR THE CONTROLLER OF SHARED ACCESS
WO2015123817A1 (en) Network data channel allocation method and allocation device, and terminal
CN115904729A (en) Method, device, system, equipment and medium for connection allocation
CN114070855B (en) Resource allocation method, resource allocation device, resource allocation system, and storage medium
CN110377417B (en) Data routing method and device
CN111147591B (en) Optimization method for dynamic allocation equipment server of Internet of things
CN111698174A (en) Dynamic flow distribution method, device, equipment and storage medium
CN113703976B (en) FPGA resource allocation method, device, equipment and readable storage medium
CN113179308B (en) Service request processing method and device, electronic equipment and storage medium
CN110866027A (en) System and method for improving block chain query efficiency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant