Bus resource configuration method and device
By allocating initial transmission resources according to the device information of the terminal equipment connected to the bridge at the server startup, and dynamically updating resources according to the data transmission status in the running state, the problem of low bus resource allocation efficiency is solved, and more efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202411706756.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-26
AI Technical Summary
During the server startup process, the controller may cause insufficient or excessive bus resources when allocating bus resources by some bridges, resulting in low bus resource allocation efficiency.
When the processor is started, the initial transmission resources are allocated according to the device information of the terminal devices connected to each bridge, and when the processor is in the running state, the resource requirements of the bridge are predicted according to the data transmission state, and the initial transmission resources are dynamically updated.
It realizes dynamic adjustment of the initial transmission resources according to the actual transmission resource requirements of the bridge, avoids communication abnormalities caused by insufficient resource allocation, and improves the allocation efficiency of bus resources.
Smart Images

Figure CN119201253B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and in particular, to a method and device for configuring bus resources. Background Art
[0002] During the startup process of the server, the controller used to control the startup of the server is responsible for allocating bus resources to the devices connected to the bridge during system initialization to ensure the normal operation of the system. That is, in the server, the device is connected to the communication bus of the processor through the bridge to achieve the expansion of the number of devices connected to the communication bus. At this time, it is necessary to allocate bus resources to each bridge on the processor through the controller, so that the devices connected to the bridge can transmit data with the processor through the allocated bus resources. In the related art, the controller will evenly allocate the bus resources configured by the processor for the communication bus according to the data of the bridge connected to the processor. However, since the devices connected to different bridges are different, their demand for bus resources is also different. Therefore, when allocating bus resources, some bridges may have insufficient bus resources, resulting in OOR (out of resource) of the communication bus and excess bus resources of some bridges, resulting in low bus resource configuration efficiency. Summary of the invention
[0003] The embodiments of the present application provide a method and device for configuring bus resources, so as to at least solve the problem of low configuration efficiency of bus resources in the related art.
[0004] According to an embodiment of the present application, a method for configuring bus resources is provided. A server includes a processor, a controller, and a plurality of bridges. Each of the bridges is connected to a communication bus on the processor. The controller is connected to the processor. The method is applied to the controller and includes:
[0005] During the startup of the processor, initial transmission resources are allocated to the bridge on the communication bus according to the device information of the first terminal device connected to each bridge;
[0006] When the processor is in a running state, controlling the processor to collect a data transmission state of each first terminal device in the communication bus;
[0007] In a case where the data transmission state is used to indicate that a first bridge exists among the plurality of bridges, predicting a current resource requirement of the first bridge according to the data transmission state, wherein the resource requirement is used to indicate the amount of transmission resources required to be used in addition to the initial transmission resources;
[0008] The initial transmission resource allocated by the first bridge on the processor is updated according to the resource requirement.
[0009] Optionally, allocating initial transmission resources to the bridge on the communication bus according to the device information of the first terminal device connected to each bridge includes:
[0010] Predicting initial configuration information of each of the bridges according to the device information, wherein the initial configuration information is used to indicate the transmission resource requirements of the bridge for the communication bus in the current device connection state;
[0011] The processor is controlled to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information.
[0012] Optionally, predicting the initial configuration information of each bridge according to the device information includes:
[0013] Calculating a sum of target demand quantities of the first terminal devices connected to a plurality of the bridges to obtain a first resource quantity, wherein the device information includes the target demand quantity;
[0014] Subtracting the first amount of resources from the total amount of transmission resources configured by the processor for the communication bus to obtain a remaining amount of transmission resources;
[0015] Determining a second resource amount allocated to each of the bridges from the remaining amount of transmission resources;
[0016] The sum of the second resource amount and the corresponding target demand amount of the first terminal device connected to the bridge is determined as a candidate demand amount of the bridge for transmission resources of the communication bus, wherein the initial configuration information includes the candidate demand amount.
[0017] Optionally, determining the second resource amount allocated to each bridge from the remaining amount of transmission resources includes one of the following:
[0018] Evenly divide the remaining amount of transmission resources according to the number of the bridges connected to the processor to obtain the second amount of resources for each bridge;
[0019] Calculate the sum of the target demand quantities of the first terminal devices connected to each of the bridges to obtain the third resource quantity of the transmission resources required by the bridge on the communication bus; allocate the remaining amount of transmission resources according to the ratio relationship between the third resource quantities of the bridges connected to the processor to obtain the second resource quantity of each bridge.
[0020] Optionally, controlling the processor to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information includes:
[0021] Filtering out a second bridge to which transmission resources are currently to be allocated from a plurality of bridges according to the first priority of each of the bridges;
[0022] The initial transmission resource is allocated to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge, wherein the bus resource space includes transmission resources configured for the communication bus in the processor.
[0023] Optionally, allocating the initial transmission resource to the second bridge in an unoccupied transmission resource in a bus resource space according to the initial configuration information of the second bridge includes:
[0024] Determine the starting address of the second bridge from the addresses of unoccupied transmission resources according to the sequence of resource addresses in the bus resource space;
[0025] Determine the end address of the second bridge in the bus resource space according to the candidate demand quantity with the start address as the starting point, wherein the candidate demand quantity is the quantity of transmission resources required by the second bridge on the communication bus, the initial configuration information includes the candidate demand quantity, and the quantity of resources between the start address and the end address is equal to the candidate demand quantity of the second bridge for transmission resources;
[0026] The transmission resources located between the start address and the end address in the bus resource space are determined as the initial transmission resources.
[0027] Optionally, allocating the initial transmission resource to the second bridge in an unoccupied transmission resource in a bus resource space according to the initial configuration information of the second bridge includes:
[0028] Filtering, according to the second priority of the first terminal device connected to the second bridge, a reference terminal device to which transmission resources are currently to be allocated from the first terminal devices connected to the second bridge;
[0029] Select candidate transmission resources whose resource size matches the fourth resource amount of transmission resources required by the reference terminal device in the communication bus from the unoccupied transmission resources in the bus resource space, wherein the initial transmission resources include the candidate transmission resources corresponding to each of the first terminal devices in the second bridge, and the initial configuration information includes the fourth resource amount of each of the first terminal devices connected to the second bridge.
[0030] Optionally, updating the initial transmission resource allocated by the first bridge on the processor according to the resource demand includes:
[0031] Filtering out a first transmission resource matching the resource requirement from the initial transmission resources configured for the third bridge in the processor, wherein the third bridge is a bridge other than the first bridge among the plurality of bridges;
[0032] The initial transmission resource is updated using the first transmission resource.
[0033] Optionally, the selecting a first transmission resource matching the resource requirement from the initial transmission resources configured in the processor for the third bridge includes:
[0034] Acquire a second transmission resource in the initial transmission resource configured for the third bridge that is in an unoccupied state;
[0035] A transmission resource in the second transmission resource whose resource amount matches the resource demand amount is determined as the first transmission resource.
[0036] Optionally, predicting a current resource requirement of the first bridge according to the data transmission state includes:
[0037] Filtering out a second terminal device from the first terminal device connected to the first bridge, wherein the second terminal device is a terminal device connected to the first bridge and having a transmission resource expansion requirement;
[0038] The resource requirement is determined according to a data transmission bandwidth between the second terminal device and the processor, wherein the data transmission status includes the data transmission bandwidth.
[0039] Optionally, the step of selecting a second terminal device from the first terminal devices connected to the first bridge includes:
[0040] Filtering a third terminal device from the first terminal device connected to the first bridge, wherein the transmission resource demand of the third terminal device in the communication bus is a non-fixed value;
[0041] matching the data transmission bandwidth of each of the third terminal devices with a preset bandwidth threshold of the third terminal device, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the third terminal device and the processor in the communication bus;
[0042] When the data transmission bandwidth does not match the preset bandwidth threshold, the third terminal device is determined as the second terminal device.
[0043] Optionally, determining the resource requirement according to a data transmission bandwidth between the second terminal device and the processor includes:
[0044] Calculate the difference between the data transmission bandwidth of each second terminal device and a preset bandwidth threshold of the second terminal device to obtain a first bandwidth value, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the second terminal device and the processor in the communication bus;
[0045] Calculate the sum of the first bandwidth values corresponding to the plurality of the second terminal devices to obtain a second bandwidth value;
[0046] The second bandwidth value is used to convert the resource requirement currently required by the first bridge.
[0047] Optionally, after collecting, by the processor, the data transmission status of each first terminal device in the communication bus, the method further includes:
[0048] Calculating a bandwidth and value of a data transmission bandwidth of the first terminal device connected to the bridge, wherein the data transmission bandwidth is used to indicate a data transmission status between the first terminal device and the processor through the communication bus, and the data transmission status includes the data transmission bandwidth;
[0049] In a case where the transmission resource demand corresponding to the bandwidth and value is greater than the resource amount allowed to be used by the initial transmission resource configured by the bridge, the bridge is determined as the first bridge.
[0050] Optionally, before predicting the initial configuration information of each bridge according to the device information, the method further includes:
[0051] Sending a target detection instruction to the processor, wherein the target detection instruction is used to instruct the processor to detect the first terminal device connected to each of the bridges, and report the device identification of the first terminal device to the controller;
[0052] When the device identification reported by the processor is received, the device information is generated for each first terminal device according to the device identification and the device information set, wherein the device information set records the transmission resource requirements of the terminal devices deployed on the server before the current moment in the communication bus.
[0053] Optionally, generating the device information for each first terminal device according to the device identifier and the device information set includes:
[0054] Extracting multiple reference demand quantities of the first terminal device corresponding to the device identifier from the device information set, wherein the multiple reference demand quantities are the transmission resource quantities required by the processor in the communication bus in multiple operation cycles before the current moment;
[0055] The largest demand among the multiple reference demands is determined as a target demand of the first terminal device, wherein the device information includes the target demand.
[0056] Optionally, before generating the device information for each first terminal device according to the device identifier and the device information set, the method further includes:
[0057] Matching the device identification with bridge information of the bridge, wherein the bridge information is used to indicate an identification of a device running and connected on the bridge;
[0058] In the case where the device identification and the bridge information match each other, the device information is generated for each first terminal device according to the device identification and the device information set.
[0059] According to another embodiment of the present application, a bus resource configuration device is provided, wherein the server includes a processor, a controller, and a plurality of bridges, each of the bridges is connected to a communication bus on the processor, the controller is connected to the processor, the device is applied to the controller, and the device includes:
[0060] an allocation module, configured to allocate initial transmission resources to the bridge on the communication bus according to device information of the first terminal device connected to each bridge during the process of controlling the startup of the processor, wherein the device information is used to indicate the transmission resource demand of the first terminal device for the communication bus before the current moment;
[0061] a control module, configured to collect, through the processor, a data transmission status of each first terminal device in the communication bus when the processor is in a running state;
[0062] a prediction module, configured to predict a current resource requirement of the first bridge according to the data transmission status when the data transmission status is used to indicate that a first bridge exists among the plurality of bridges, wherein the resource requirement is used to indicate a quantity of transmission resources required to be used in addition to the initial transmission resources;
[0063] An updating module is used to update the initial transmission resource allocated by the first bridge on the processor according to the resource demand.
[0064] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0065] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0066] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0067] Through the present application, in the process of controlling the startup of the processor, by allocating initial transmission resources to the bridge according to the device information of the first terminal device connected to the bridge, it is possible to predict the current bus demand of the bridge according to the historical demand of the first terminal device for the bus transmission resources, so that the allocated initial transmission resources match the demand of the first terminal device connected to the bridge for the communication bus transmission resources, and then in the process of the processor being run, by controlling the processor to collect the data transmission status of each first terminal device in the communication bus, and then in the case where the data transmission status is used to indicate that there is a first bridge among multiple bridges whose initial transmission resources do not meet its transmission resource demand, by predicting the current actual resource demand of the first bridge according to the data transmission status, and then by using the resource demand to update the initial transmission resources allocated by the first bridge on the processor, it is possible to dynamically adjust the initial transmission resources according to the actual transmission resource demand of the bridge, avoid abnormal communication between the processor and the first terminal device due to insufficient resource allocation, and at the same time, improve the utilization rate of the transmission resources allocated to the communication bus on the processor, avoid waste of transmission resources, solve the problem of low configuration efficiency of bus resources in related technologies, and achieve the effect of improving the configuration efficiency of bus resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1It is a hardware structure block diagram of a server device of a bus resource configuration method according to an embodiment of the present application;
[0069] Figure 2 is a flowchart of a method for configuring bus resources according to an embodiment of the present application;
[0070] Figure 3 is a hardware connection diagram of a bus resource configuration method according to an embodiment of the present application;
[0071] Figure 4 It is a flow chart of a method for reserving BUS resources for a PCIE device BUS and resolving BUS OOR according to an embodiment of the present application;
[0072] Figure 5 It is a structural block diagram of a bus resource configuration device according to an embodiment of the present application. DETAILED DESCRIPTION
[0073] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0074] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0075] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 FIG. 1 is a hardware structure diagram of a server device of a bus resource configuration method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0076] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the bus resource configuration method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0077] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0078] In this embodiment, a method for configuring bus resources is provided. Figure 2 is a flowchart of a method for configuring bus resources according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0079] Step S202, during the startup of the processor, allocating initial transmission resources for the bridge on the communication bus according to the device information of the first terminal device connected to each bridge, wherein the device information is used to indicate the transmission resource demand of the first terminal device for the communication bus before the current moment;
[0080] Step S204, when the processor is in the running state, controlling the processor to collect the data transmission state of each of the target terminal devices and the first terminal device in the communication bus;
[0081] Step S206, when the data transmission state is used to indicate that a first bridge exists among the plurality of bridges, predicting a current resource requirement of the first bridge according to the data transmission state, wherein the resource requirement is used to indicate the amount of transmission resources required to be used in addition to the initial transmission resources;
[0082] Step S208: updating the initial transmission resource allocated by the first bridge on the processor according to the resource demand.
[0083] Through the above steps, in the process of controlling the processor to start up, by allocating initial transmission resources to the bridge according to the device information of the first terminal device connected to the bridge, the current bus demand of the bridge is predicted according to the historical demand of the first terminal device for the bus transmission resources, so that the allocated initial transmission resources match the demand of the first terminal device connected to the bridge for the communication bus transmission resources. Then, in the process of the processor being run, the data transmission status of each first terminal device in the communication bus is collected by the control processor. Then, in the case where the data transmission status is used to indicate that there is a first bridge among multiple bridges whose initial transmission resources do not meet its transmission resource demand, the actual current resource demand of the first bridge is predicted according to the data transmission status, and then the initial transmission resources allocated to the processor by the first bridge are updated by using the resource demand, so as to realize dynamic adjustment of the initial transmission resources according to the actual transmission resource demand of the bridge, avoid abnormal communication between the processor and the first terminal device due to insufficient resource allocation, and improve the utilization rate of the transmission resources allocated to the communication bus on the processor, avoid waste of transmission resources, solve the problem of low configuration efficiency of bus resources in the related art, and achieve the effect of improving the configuration efficiency of bus resources.
[0084] Optionally, in the embodiments of the present application, Figure 3 is a hardware connection diagram of a bus resource configuration method according to an embodiment of the present application, such as Figure 3 As shown, the server includes a processor, a controller, multiple bridges and multiple terminal devices, wherein the controller is connected to the processor, multiple bridges are connected to the communication bus on the processor, and each bridge is connected to multiple terminal devices.
[0085] Optionally, in the embodiment of the present application, the controller is used to control the startup state of the server, such as allocating corresponding bus resources on the processor for the device connected to the bridge, so as to connect the device connected to the bridge to the target communication bus of the processor, which can be achieved by deploying and running a control program with the function of controlling the startup state of the server, such as deploying BIOS (Basic Input / Output System) in the controller, and controlling the startup state of the server by running BIOS, the communication bus can be but not limited to PCIe (Peripheral Component Interconnect Express, high-speed serial computer expansion bus standard) bus, BIOS (Basic Input Output System), as the lowest level and most direct hardware setting and control manager of the server motherboard, can provide more simple usability functions for the server. BIOS is a bridge connecting hardware devices and software programs. During the boot process, BIOS first performs self-test initialization on the hardware device. The self-test process includes self-testing the CPU, memory, motherboard, serial and parallel ports, and hard disk devices, and loading drivers such as PCIe devices and I / O devices. As a local bus of the processor system, the main purpose of the PCIe bus is to connect external devices in the processor system. The PCIe link uses an end-to-end data transmission method. In a PCIe link, the two ports are completely equivalent, connecting the sending and receiving devices respectively, and one end of a PCIe link can only connect to a sending device or a receiving device. The PCIe links that can be extended by different processors vary according to the design and support capabilities of the processors. The use of the extended PCIe links of the processors by different server manufacturers is also different. According to the hardware design of different hardware, the design and use of the processor PCIe link are also inconsistent. Different external devices are connected using PCIe links for different hardware designs, and different hardware PCIe devices have different support for PCIe links according to their own designs.
[0086] Optionally, in an embodiment of the present application, a bridge is used to connect multiple terminal devices to the communication bus of the processor, thereby reducing the occupancy of the communication bus interface on the processor, and virtualizing the bridge as a virtual device connected to the communication bus on the processor side. When the communication bus is a PCIe bus, the bridge can be a PCIE Stack (PCIExpress stack), which is not limited in this solution.
[0087] Optionally, in an embodiment of the present application, the processor is configured with transmission resources for the communication bus, so that communication with the device connected to the bridge can be achieved through the communication bus through the transmission resources. In the embodiment of the present application, the processor can be a CPU (Central Processing Unit) deployed in the server. During the startup process of the server, the BIOS (controller) is responsible for allocating system resources, including allocating resources to PCIe devices (first terminal devices). During the startup process, the BIOS will scan all PCIe bridges (bridges) and devices according to the PCIe topology and allocate Bus / IO / Mmio resources (transmission resources) to ensure the normal operation of the system.
[0088] In the embodiment provided in the above step S202, the device information is data information used to indicate the transmission resource demand of the first terminal device for the communication bus before the current moment. The device information may include but is not limited to historical bus resource usage, bandwidth demand, etc., and this solution does not limit this. The device information before the current moment is the information obtained by the first terminal device when communicating with the processor on the target communication bus of the processor, that is, the device information can be historical data of the historical communication cycle, or it can also be obtained after test communication between the target device and the processor through the communication bus in the test cycle set before the current moment, that is, a test cycle is configured before the execution of step S202, and the test cycle controller will allocate the transmission resources configured for the communication bus on the processor to each bridge according to the bus resource allocation mechanism, so as to test whether OOR occurs when the terminal device connected to the bridge uses the transmission resources allocated to the corresponding bridge to communicate with the processor, and then obtain the device information of each terminal device; in the embodiment of the present application, the bus resource allocation mechanism can be to evenly divide the bus resources of the processor according to the number of bridges connected to the processor, or it can also be to proportionally allocate the bus resources on the processor according to the proportional relationship between the number of first terminal devices connected to each bridge, and this scheme is not limited to this.
[0089] Optionally, in an embodiment of the present application, the controller will analyze the characteristics of each device and the historical resource requirements based on the device information of the devices connected to each bridge, and then allocate appropriate initial transmission resources to the bridge on the communication bus. For example, different terminal devices have different requirements for bandwidth and latency. High-performance computing devices such as GPU accelerator cards may require high-bandwidth and low-latency bus resources. In this case, more high-bandwidth and low-latency bus resources will be allocated to the device. This solution does not limit this.
[0090] In the embodiment provided in the above step S204, the data transmission status of each first terminal device in the communication bus is collected by the processor, which can be: calling the target interface configured on the controller to collect the data transmission bandwidth between each first terminal device and the processor, wherein the target interface is used to detect the data transmission bandwidth between each first terminal device and the processor, and the data transmission status includes the data transmission bandwidth. That is, in the embodiment of the present application, an interface program for monitoring the data transmission status of the terminal device on the communication bus is configured in the control program running in the controller, so as to collect the data transmission status, such as obtaining the data transmission bandwidth of the device on the PCIE link.
[0091] In the embodiment provided in the above step S206, the data transmission status is used to indicate the actual data transmission situation when each first terminal device communicates with the processor through the communication bus, that is, the actual data transmission bandwidth of each first terminal device on the communication bus, so that the bandwidth can reflect the consumption of the transmission resources allocated by the bridge on the processor by each first terminal device. When the total amount of transmission resource consumption is greater than the total amount of initial transmission resources actually allocated by the bridge on the processor, the bridge can be identified as the first bridge.
[0092] Optionally, in an embodiment of the present application, the first bridge is a bridge among multiple bridges to which the initial transmission resources allocated do not meet the current transmission resource requirements.
[0093] Optionally, in an embodiment of the present application, when the data transmission status is used to indicate the existence of a first bridge among multiple bridges, the current resource demand of the first bridge can be predicted based on the data transmission status. The difference between the actual data transmission bandwidth of each first terminal device connected to the first bridge on the communication bus and the maximum data transmission bandwidth between the first terminal device and the processor in the communication bus can be calculated, so as to obtain the remaining bandwidth of each terminal device on the first bridge, and then use the sum of the remaining bandwidth of each terminal device on the first bridge as the current resource demand of the first bridge.
[0094] In the embodiment provided in the above step S208, after predicting the current resource demand of the first bridge, the initial transmission resources allocated by the first bridge on the processor are further updated according to the resource demand. This may be by screening out a bridge that can provide excess bus resources for the first bridge from a plurality of bridges other than the first bridge, thereby achieving dynamic allocation of transmission resources between bridges, avoiding waste of transmission resources due to excessive transmission resources allocated on the bridge, and improving the utilization efficiency of the transmission resources allocated on the processor for the communication bus.
[0095] Optionally, in an embodiment of the present application, the bus resources of all bridges can be reallocated based on the predicted current resource demand of the first bridge and the usage of bus resources by terminal devices connected to bridges other than the first bridge, so that during the secondary resource allocation, devices with higher resource demands can be given priority, resource usage on each bridge can be balanced, and communication abnormalities between the processor and the first terminal device due to unreasonable resource allocation can be avoided, thereby improving the overall utilization of bus resources on the processor and the operating efficiency of each terminal device.
[0096] As an optional embodiment, allocating initial transmission resources to the bridge on the communication bus according to the device information of the first terminal device connected to each bridge includes:
[0097] Predicting initial configuration information of each of the bridges according to the device information, wherein the initial configuration information is used to indicate the transmission resource requirements of the bridge for the communication bus in the current device connection state;
[0098] The processor is controlled to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information.
[0099] Optionally, in an embodiment of the present application, the device information is information used to characterize the demand for transmission resources of the communication bus by the first terminal device during the historical operating time before the current moment, and the device information can reflect the demand for transmission resources of each first terminal device at the current moment, thereby predicting the initial configuration information. Therefore, the transmission resource demand of the first terminal device indicated by the device information before the current moment can be used as the current transmission resource demand of the first terminal device, and then the initial configuration information of the bridge can be obtained by accumulating the transmission resource demands of each target device connected to the bridge at the current moment, or the transmission resource demands of each target device connected to the bridge at the current moment can be accumulated, and additional transmission resource surplus can be configured on the basis of the accumulated transmission resource to obtain the initial configuration information, thereby avoiding the occurrence of OOR of the communication bus.
[0100] Through the above method, the server system can intelligently predict and allocate the transmission resource requirements of the communication bus under the current device connection state of the bridge according to the transmission resource requirements of the communication bus of the first terminal device connected to the bridge before the current moment, thereby optimizing the configuration adaptability of the bus resources during the initial startup phase of the server.
[0101] As an optional embodiment, predicting the initial configuration information of each bridge according to the device information includes:
[0102] Calculating a sum of target demand quantities of the first terminal devices connected to a plurality of the bridges to obtain a first resource quantity, wherein the device information includes the target demand quantity;
[0103] Subtracting the first amount of resources from the total amount of transmission resources configured by the processor for the communication bus to obtain a remaining amount of transmission resources;
[0104] Determining a second resource amount allocated to each of the bridges from the remaining amount of transmission resources;
[0105] The sum of the second resource amount and the corresponding target demand amount of the first terminal device connected to the bridge is determined as a candidate demand amount of the bridge for transmission resources of the communication bus, wherein the initial configuration information includes the candidate demand amount.
[0106] Optionally, in an embodiment of the present application, the first resource amount is used to represent the sum of the target demand amounts for bus resources of all devices on each bridge during the startup phase, and the remaining transmission resources are obtained by subtracting the first resource amount from the total transmission resources configured by the processor for the communication bus.
[0107] Optionally, in an embodiment of the present application, the second amount of resources is the amount of resources allocated to each bridge in the remaining amount of transmission resources. The second amount of resources can be evenly allocated to each bridge based on the remaining amount of transmission resources and the total number of bridges, or it can be a weight parameter assigned to each type of device connected to the bridge (for example, the weight of key business devices (such as network adapters, storage controllers) is set to 1.0, high-performance computing devices (such as GPUs, FPGAs) are set to 0.8, and auxiliary devices (such as sound cards, USB controllers) are set to 0.2.), and then the weight parameters of all devices on the bridge are added and calculated to obtain a weight score. According to the proportion of the final weight score of each bridge in all bridges, a second amount of resources corresponding to its proportion is allocated to each bridge in the remaining amount of transmission resources.
[0108] Optionally, in an embodiment of the present application, the sum of the second resource amount of each bridge and the target demand amount of the first terminal device connected to the bridge is used as the candidate demand amount, that is, the initial transmission resource amount finally allocated to each bridge during the startup phase.
[0109] Through the above steps, the second resource amount is allocated to each bridge according to the situation of the device connected to each bridge, and then the sum of the second resource amount of each bridge and the target demand amount of the first terminal device connected to the bridge is determined as the initial transmission resource amount, thereby achieving reasonable allocation of bus resources and improving resource utilization efficiency.
[0110] As an optional embodiment, determining the second resource amount allocated to each bridge from the remaining amount of transmission resources includes one of the following:
[0111] Evenly divide the remaining amount of transmission resources according to the number of the bridges connected to the processor to obtain the second amount of resources for each bridge;
[0112] Calculate the sum of the target demand quantities of the first terminal devices connected to each of the bridges to obtain the third resource quantity of the transmission resources required by the bridge on the communication bus; allocate the remaining amount of transmission resources according to the ratio relationship between the third resource quantities of the bridges connected to the processor to obtain the second resource quantity of each bridge.
[0113] Optionally, in an embodiment of the present application, the second amount of resources allocated to each bridge is determined in the remaining amount of transmission resources. The remaining amount of transmission resources can be evenly distributed to each bridge according to the total number of bridges connected to the processor, or the sum of the target demand amounts of all first terminal devices connected to each bridge is first calculated to obtain the third amount of resources required by the bridge, and then the remaining amount of transmission resources is allocated to each bridge in a corresponding proportion according to the ratio between the third amounts of resources of all bridges to obtain the second amount of resources for each bridge, that is, more bus resources are allocated to bridges with higher bus requirements, thereby better meeting the performance requirements of high-demand devices and avoiding waste of resources or insufficient resources of key devices.
[0114] Optionally, in an embodiment of the present application, allocation can also be based on the ratio relationship between the sum of the bandwidth surpluses of devices with reserved resource requirements (such as hot-plug requirements) on each bridge: the bandwidth surplus of the device connected to each bridge is calculated, and the bandwidth surplus is the difference between the maximum bandwidth requirement of the device and the reserved bandwidth resources; the sum of the bandwidth surpluses on each bridge is summarized; the ratio relationship between the bandwidth surpluses and values of each bridge is calculated; and the transmission resource surplus is allocated to each bridge according to the ratio relationship.
[0115] Through the above steps, the second resource amount is reasonably allocated to each bridge according to the resource demand of the device connected to each bridge, which helps to achieve load balancing, ensures that the resource allocation between each bridge is more in line with the actual needs of the connected devices, and improves the resource utilization efficiency.
[0116] As an optional embodiment, controlling the processor to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information includes:
[0117] Filtering out a second bridge to which transmission resources are currently to be allocated from a plurality of bridges according to the first priority of each of the bridges;
[0118] The initial transmission resource is allocated to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge, wherein the bus resource space includes transmission resources configured for the communication bus in the processor.
[0119] Optionally, in an embodiment of the present application, the first priority can be set based on factors such as the type of device connected to the bridge (such as a control device, a storage device, etc.), the importance of the device (such as a critical business device, a data-intensive device, etc.), and the bandwidth requirement of the device, that is, initial transmission resources are allocated preferentially to the bridge connected to devices of high importance or large bandwidth requirements.
[0120] Optionally, in an embodiment of the present application, initial transmission resources are allocated to the second bridge based on the initial configuration information of the second bridge. The initial transmission resources may be allocated to the bridge based on the demand for resources of the bridge as the minimum unit, or the initial transmission resources may be allocated to the bridge based on the demand for resources of each device connected to the bridge as the minimum unit. This scheme does not limit this.
[0121] Through the above steps, initial transmission resources are allocated to each bridge according to the first priority of the bridge, which can ensure that devices with higher importance obtain the required transmission resources first, thereby ensuring the normal operation of key services and the full utilization of high-performance devices, while optimizing resource utilization efficiency.
[0122] As an optional embodiment, allocating the initial transmission resource to the second bridge in an unoccupied transmission resource in a bus resource space according to the initial configuration information of the second bridge includes:
[0123] Determine the starting address of the second bridge from the addresses of unoccupied transmission resources according to the sequence of resource addresses in the bus resource space;
[0124] Determine the end address of the second bridge in the bus resource space according to the candidate demand quantity with the start address as the starting point, wherein the candidate demand quantity is the quantity of transmission resources required by the second bridge on the communication bus, the initial configuration information includes the candidate demand quantity, and the quantity of resources between the start address and the end address is equal to the candidate demand quantity of the second bridge for transmission resources;
[0125] The transmission resources located between the start address and the end address in the bus resource space are determined as the initial transmission resources.
[0126] Optionally, in an embodiment of the present application, initial transmission resources may be allocated to the bridge based on the bridge's demand for resources as the minimum unit, that is, the addresses of unoccupied transmission resources are sorted, and the starting address for allocation to the second bridge is determined from the addresses of the unoccupied transmission resources according to the sorting result, and then the bus resource space is used to find a continuous unoccupied transmission resource range with a resource amount equal to the candidate demand amount of the second bridge starting from the starting address, and the end address of the resource range found is determined as the end address of the second bridge, and then the transmission resources between the starting address and the end address in the bus resource space are determined as the initial transmission resources.
[0127] Through the above steps, the system can accurately determine and allocate unoccupied transmission resources in the bus resource space, meet the resource requirements of the second bridge, and ensure fairness and efficiency of resource allocation.
[0128] As an optional embodiment, allocating the initial transmission resource to the second bridge in an unoccupied transmission resource in a bus resource space according to the initial configuration information of the second bridge includes:
[0129] Filtering, according to the second priority of the first terminal device connected to the second bridge, a reference terminal device to which transmission resources are currently to be allocated from the first terminal devices connected to the second bridge;
[0130] Select candidate transmission resources whose resource size matches the fourth resource amount of transmission resources required by the reference terminal device in the communication bus from the unoccupied transmission resources in the bus resource space, wherein the initial transmission resources include the candidate transmission resources corresponding to each of the first terminal devices in the second bridge, and the initial configuration information includes the fourth resource amount of each of the first terminal devices connected to the second bridge.
[0131] Optionally, in an embodiment of the present application, the second priority can be set based on factors such as the device's business load, the importance of the device (such as critical business equipment, data-intensive equipment, etc.), and the device's bandwidth requirements, that is, initial transmission resources are allocated preferentially to devices of high importance, large bandwidth requirements, or large business loads.
[0132] Optionally, in this embodiment of the present application, the fourth resource amount is the transmission resource amount required by each first terminal device connected to the second bridge recorded in the initial configuration information.
[0133] Optionally, in an embodiment of the present application, initial transmission resources may be allocated to the bridge based on the resource demand of each device connected to the bridge as the minimum unit, that is, a reference resource space whose resource size matches the fourth resource amount of the reference terminal device is divided out from the unoccupied resource space in the bus resource space, and the transmission resources in the reference resource space are determined as candidate transmission resources corresponding to the first terminal device.
[0134] Through the above steps, more refined transmission resource allocation can be achieved based on the specific needs of each terminal device and the current state of the bus resource space, thereby improving the accuracy of bus resource allocation and the utilization efficiency of bus resources.
[0135] As an optional embodiment, the updating the initial transmission resource allocated by the first bridge on the processor according to the resource demand includes:
[0136] Filtering out a first transmission resource matching the resource requirement from the initial transmission resources configured for the third bridge in the processor, wherein the third bridge is a bridge other than the first bridge among the plurality of bridges;
[0137] The initial transmission resource is updated using the first transmission resource.
[0138] Optionally, in an embodiment of the present application, the initial transmission resources of the first bridge do not meet its transmission resource requirements, so the initial transmission resources of the first bridge need to be adjusted, and the resource requirement is the amount of additional transmission resources that need to be added to the first bridge during the adjustment process.
[0139] Optionally, in an embodiment of the present application, the first transmission resource may be a transmission resource allocated from a single third bridge, that is, when the amount of unoccupied transmission resources in a single third bridge is greater than the resource demand, the first transmission resource that meets the resource demand is extracted from the third bridge, or when the unoccupied amount in each third bridge is less than the resource demand, a part of the unoccupied transmission resources of each bridge in multiple third bridges can be extracted to piece together the first transmission resource that meets the resource demand. In this way, the amount of transmission resources extracted from the unoccupied transmission resources of each third bridge can be determined based on the proportional relationship between the unoccupied transmission resources of each third bridge.
[0140] Through the above steps, the first transmission resource that meets the resource demand can be extracted from a single bridge with more idle resources, or the first transmission resource that meets the resource demand can be pieced together from multiple bridges with fewer idle resources, thereby optimizing the resource allocation between each bridge and improving the configuration efficiency of bus resources.
[0141] As an optional embodiment, selecting the first transmission resource matching the resource requirement from the initial transmission resources configured in the processor for the third bridge includes:
[0142] Acquire a second transmission resource in the initial transmission resource configured for the third bridge that is in an unoccupied state;
[0143] A transmission resource in the second transmission resource whose resource amount matches the resource demand amount is determined as the first transmission resource.
[0144] Optionally, in an embodiment of the present application, unoccupied idle resources in other bridges may be allocated to the first bridge for use, that is, transmission resources matching the resource demand may be screened out from unoccupied resources in the initial transmission resources of the third bridge and determined as the first transmission resources.
[0145] Through the above steps, by allocating the idle resources in other bridges that are not occupied to the first bridge, the resource configuration between the bridges can be optimized, thereby improving the configuration efficiency of the bus resources.
[0146] As an optional embodiment, predicting the current resource requirement of the first bridge according to the data transmission state includes:
[0147] Filtering out a second terminal device from the first terminal device connected to the first bridge, wherein the second terminal device is a terminal device connected to the first bridge and having a transmission resource expansion requirement;
[0148] The resource requirement is determined according to a data transmission bandwidth between the second terminal device and the processor, wherein the data transmission status includes the data transmission bandwidth.
[0149] Optionally, in an embodiment of the present application, the second terminal device is a device connected to the first bridge and has a bus resource demand that is greater than its bus resource usage, and the resource demand is determined based on the data transmission bandwidth between the second terminal device and the processor. The resource demand corresponding to the data transmission bandwidth between the second terminal device and the processor can be determined from a mapping table with a corresponding relationship between data transmission bandwidth and resource amount.
[0150] Through the above steps, by screening out the second terminal device with transmission resource expansion demand and determining the resource demand according to the data transmission bandwidth between the second terminal device and the processor, the transmission resource configuration between the bridges can be dynamically adjusted, thereby improving the utilization of bus resources.
[0151] As an optional embodiment, the step of selecting a second terminal device from the first terminal devices connected to the first bridge includes:
[0152] Filtering a third terminal device from the first terminal device connected to the first bridge, wherein the transmission resource demand of the third terminal device in the communication bus is a non-fixed value;
[0153] matching the data transmission bandwidth of each of the third terminal devices with a preset bandwidth threshold of the third terminal device, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the third terminal device and the processor in the communication bus;
[0154] When the data transmission bandwidth does not match the preset bandwidth threshold, the third terminal device is determined as the second terminal device.
[0155] Optionally, in an embodiment of the present application, the data transmission bandwidth of each third terminal device needs to be matched with a preset bandwidth threshold of the third terminal device. For example, the maximum bandwidth of the port of each connected device is x16. When the port is connected to a x16 terminal device, there is no need to expand resources on the port, and only the number of resources of the x16 device needs to be calculated. Therefore, when the data transmission bandwidth is less than the preset bandwidth threshold, the third terminal device needs to be determined as the second terminal device.
[0156] Through the above steps, by screening out the second terminal devices whose data transmission bandwidth is less than the preset bandwidth threshold, bus resource expansion can be performed for the terminal devices with transmission resource expansion requirements, thereby improving the utilization efficiency of the bus resources.
[0157] As an optional embodiment, determining the resource requirement according to a data transmission bandwidth between the second terminal device and the processor includes:
[0158] Calculate the difference between the data transmission bandwidth of each second terminal device and a preset bandwidth threshold of the second terminal device to obtain a first bandwidth value, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the second terminal device and the processor in the communication bus;
[0159] Calculate the sum of the first bandwidth values corresponding to the plurality of the second terminal devices to obtain a second bandwidth value;
[0160] The second bandwidth value is used to convert the resource requirement currently required by the first bridge.
[0161] Optionally, in an embodiment of the present application, the difference between the data transmission bandwidth of the second terminal device and a preset bandwidth threshold is first calculated. For example, the maximum data transmission bandwidth of the port used to connect the processor and the second terminal device is x16, and the data transmission bandwidth of the second terminal device is x8. Then, the first bandwidth value of the second terminal device is x8, and then the first bandwidth values of multiple second terminal devices in the first bridge are summed to obtain the second bandwidth value.
[0162] Optionally, in the embodiment of the present application, the resource demand corresponding to the second bandwidth value may be determined from a mapping table of bandwidth values and resource amounts having a corresponding relationship.
[0163] Through the above steps, the second bandwidth value is obtained by calculating the sum of the first bandwidth values of all the second terminal devices on the first bridge, and then the resource demand is converted according to the second bandwidth value. This can achieve accurate and reasonable allocation of required bus resources for the first bridge according to the resource receiving capacity of the terminal devices connected to the first bridge, thereby improving the utilization rate of the bus resources.
[0164] As an optional embodiment, after collecting, by the processor, the data transmission status of each first terminal device in the communication bus, the method further includes:
[0165] Calculating a bandwidth and value of a data transmission bandwidth of the first terminal device connected to the bridge, wherein the data transmission bandwidth is used to indicate a data transmission status between the first terminal device and the processor through the communication bus, and the data transmission status includes the data transmission bandwidth;
[0166] In a case where the transmission resource demand corresponding to the bandwidth and value is greater than the resource amount allowed to be used by the initial transmission resource configured by the bridge, the bridge is determined as the first bridge.
[0167] Optionally, in an embodiment of the present application, the bandwidth and value of the data transmission bandwidth of the first terminal device connected to the bridge reflects the total demand for bus resources of all devices on the bridge. Therefore, when the transmission resource demand corresponding to the bandwidth and value is greater than the amount of resources allowed by the initial transmission resources configured by the bridge, it means that the demand for resources of the bridge exceeds the pre-allocated range, and the bridge is determined to be the first bridge.
[0168] Through the above steps, by comparing the transmission resource demand corresponding to the bandwidth and value of the connected device on the bridge and the resource amount corresponding to its initial transmission resource, the first bridge with insufficient resource allocation can be accurately identified, thereby improving the efficiency of identifying the first bridge.
[0169] As an optional embodiment, before predicting the initial configuration information of each bridge according to the device information, the method further includes:
[0170] Sending a target detection instruction to the processor, wherein the target detection instruction is used to instruct the processor to detect the first terminal device connected to each of the bridges, and report the device identification of the first terminal device to the controller;
[0171] When the device identification reported by the processor is received, the device information is generated for each first terminal device according to the device identification and the device information set, wherein the device information set records the transmission resource requirements of the terminal devices deployed on the server before the current moment in the communication bus.
[0172] Optionally, in an embodiment of the present application, the device identifier is a unique identifier used to characterize the identity of the terminal device. The device identifier of the terminal device may include, but is not limited to, DID (Device ID, a unique number used to identify a specific hardware model produced by a specific manufacturer), VID (Vendor ID, a unique number used to identify the manufacturer or supplier of a hardware device), etc. This solution does not limit this.
[0173] Optionally, in an embodiment of the present application, the device information set records the transmission resource requirements of the terminal devices deployed on the server before the current moment in the communication bus, and then the device information corresponding to the device identifier of the first terminal device can be filtered in the device information set according to the device identifier of the first terminal device.
[0174] Optionally, in an embodiment of the present application, the method of generating the device information for each first terminal device based on the device identifier and the device information set may be: extracting multiple reference demand quantities of the first terminal device corresponding to the device identifier from the device information set, wherein the multiple reference demand quantities are the transmission resource quantities required by the processor in the multiple operating cycles before the current moment in time in the communication bus; and selecting a candidate resource demand quantity from the multiple reference demand quantities based on the matching relationship between the device access status on the bridge corresponding to each reference demand quantity and the current device access status on the bridge, that is, the matching degree between the device access status on the bridge corresponding to the candidate resource demand quantity and the current device access status on the bridge is the highest, thereby determining the resource demand quantity as the candidate resource demand quantity.
[0175] Through the above steps, by obtaining the device identification of the first terminal device and obtaining corresponding device information in the device information set according to the device identification, the resource demand of the first terminal device can be accurately identified.
[0176] As an optional embodiment, generating the device information for each first terminal device according to the device identifier and the device information set includes:
[0177] Extracting multiple reference demand quantities of the first terminal device corresponding to the device identifier from the device information set, wherein the multiple reference demand quantities are the transmission resource quantities required by the processor in the communication bus in multiple operation cycles before the current moment;
[0178] The largest demand among the multiple reference demands is determined as a target demand of the first terminal device, wherein the device information includes the target demand.
[0179] Optionally, in an embodiment of the present application, the controller extracts from the device information set multiple reference demands in the communication bus of the first terminal device corresponding to the device identifier in multiple operating cycles before the current moment, and these reference demands reflect the resource usage of the first terminal device under different workloads and application scenarios. Data analysis and comparison are performed on the extracted multiple reference demands to identify the maximum transmission demand among them. This maximum demand reflects the resource consumption of the device in the busiest or most resource-demanding operating cycle, and the maximum transmission demand is then determined as the target demand of the first terminal device.
[0180] Through the above steps, it can be ensured that the first terminal device can obtain resources no less than its historical maximum demand during subsequent operation, thereby reducing the probability of insufficient bus resources.
[0181] As an optional embodiment, before generating the device information for each first terminal device according to the device identifier and the device information set, the method further includes:
[0182] Matching the device identification with bridge information of the bridge, wherein the bridge information is used to indicate an identification of a device running and connected on the bridge;
[0183] In the case where the device identification and the bridge information match each other, the device information is generated for each first terminal device according to the device identification and the device information set.
[0184] Optionally, in an embodiment of the present application, each terminal device has its own unique subordinate bridge, and the bridge information records the identification of the device running and connected on the bridge. Therefore, the device identification and the bridge information of the bridge can be matched. If the match is consistent, it means that the terminal device belongs to the correct bridge, and then device information is generated for each first terminal device based on the device identification and device information set.
[0185] Through the above steps, by matching the device identification with the bridge information of the bridge, it is possible to ensure that the correct corresponding device information is subsequently obtained, thereby improving the configuration accuracy of the bus resources.
[0186] In order to better understand the above process, the above process is described in conjunction with an optional embodiment below. This embodiment takes the communication bus as a PCIe bus as an example, wherein the processor is a CPU on a server, and the controller is a device for running BIOS: In this embodiment, a method for reserving a PCIE device BUS and reserving BUS resources after BUS OOR is provided. The method provides an interface. Through the code interface, the customer can customize the number of BUSs required in the PCIE Stack (bridge) to be reserved, and reserve the corresponding number of BUSs for the PCIE Stack during the startup process. In addition, the problem that the BUS cannot be reserved for other PE Ports of the PCIE Stack after BUS OOR occurs is optimized and solved. Using this interface, the customer can reserve the BUS at will, and only needs to add the corresponding information in the interface. The method is relatively convenient and concise, and has strong reusability.
[0187] In order to solve the problem of BUS reservation for users, a code interface that can quickly adapt to reserved BUS resources is provided. The present invention proposes a method for reserving BUS resources for PCIE devices and reserving BUS resources after solving BUS OOR. Figure 4 1 is a flow chart of a method for reserving BUS resources for a PCIE device BUS and resolving BUS OOR according to an embodiment of the present application, such as Figure 4 As shown, the method has the following steps:
[0188] (1) Determine whether the device for which BUS resources need to be reserved is in place based on the DID and VID of the PCIE device. If it is in place, save the location information of the PCIE device (including CPU slot, PCIE Stack, etc.) into the device variable;
[0189] (2) When traversing all CPUs and PCIE Stacks during Bios startup and starting to pre-allocate BUS resources, reserve code interface 1, set interface 1 function to obtain device variable information set in (1), compare the CPU slot and PCIE Stack of the traversed information and the obtained device variable information, and reserve the number of BUS for the device;
[0190] (3) As the BIOS starts, the number of buses reserved in (2) will be subtracted from the total number of buses according to the number of buses required on the machine. Then, the number of buses required on each PCIE Stack and the average number of buses will be calculated as a whole to calculate the bus base and bus limit on each CPU and PCIE Stack.
[0191] (4) If the number of virtual devices actually connected to the PCIE device is greater than the number of reserved BUSs in (2) during use, then OOR will be triggered after the BIOS performs PCIE enumeration. At this time, code interface 2 is established. Code interface 2 detects that the device has OOR, and determines the DID and VID of the device to find that the device is a device with reserved BUS. At this time, code interface 3 is set to obtain the bandwidth of the device on the PCIE link. When the bandwidth is non-x16, a flag is set to indicate that an additional BUS needs to be reserved; (Why is an additional BUS reserved only when it is non-x16? Because the maximum bandwidth of each PE Port is x16. When the PE Port is connected to a x16 PCIE device, there is no need to reserve a Bus on the PE Port. Only the number of Buses of the x16 device needs to be calculated);
[0192] (5) When OOR is detected during the BIOS startup process, the number of buses actually used on the PCIE Stack will be calculated to obtain a total number of buses. Then, the Flag for the additional reserved buses in (4) will be obtained. If it is true, the total number of buses will be added to the number of additional buses that need to be reserved. The bus resources will be reallocated after a restart is performed after the OOR is triggered.
[0193] This application provides a code interface that can quickly adapt to reserve BUS resources. This application proposes a method for reserving BUS resources for PCIE devices and reserving BUS resources after resolving BUS OOR. The method reserves three code interfaces. When a user has a PCIE device that needs to reserve Bus resources, the user only needs to add the DID and VID information of the device in the three interfaces respectively, and modify the number of Bus resources that the device specifically needs to reserve, as well as the number of Buses that need to be reserved for other non-x16 PE Ports after OOR occurs. The reservation of PCIE BUS resources can be easily achieved by adapting according to actual needs. This solution can be transplanted and used on different platforms, solving the difficulty of users reserving resources for special PCIE devices, and the method is simple and convenient.
[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0195] In the present embodiment, a bus resource configuration device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0196] Figure 5 is a structural block diagram of a bus resource configuration device according to an embodiment of the present application, such as Figure 5 As shown, the device comprises:
[0197] an allocation module 52, configured to allocate initial transmission resources to the bridge on the communication bus according to device information of the first terminal device connected to each bridge during the process of controlling the startup of the processor, wherein the device information is used to indicate the transmission resource demand of the first terminal device for the communication bus before the current moment;
[0198] A control module 54, configured to collect, through the processor, a data transmission status of each first terminal device in the communication bus when the processor is in a running state;
[0199] a prediction module 56, configured to predict a current resource demand of the first bridge according to the data transmission status when the data transmission status indicates that there is a first bridge among the plurality of bridges, wherein the first bridge is a bridge for which the initial transmission resources do not meet the current transmission resource demand, and the resource demand indicates the amount of transmission resources required to be used in addition to the initial transmission resources;
[0200] The updating module 58 updates the initial transmission resource allocated by the first bridge on the processor according to the resource demand.
[0201] Through the above-mentioned device, in the process of controlling the startup of the processor, by allocating initial transmission resources to the bridge according to the device information of the first terminal device connected to the bridge, it is possible to predict the current bus demand of the bridge according to the historical demand of the first terminal device for the bus transmission resources, so that the allocated initial transmission resources match the demand of the first terminal device connected to the bridge for the communication bus transmission resources. Then, in the process of the processor being run, the data transmission status of each first terminal device in the communication bus is collected by the control processor. Then, in the case where the data transmission status is used to indicate that there is a first bridge whose initial transmission resources do not meet its transmission resource demand among multiple bridges, by predicting the current actual resource demand of the first bridge according to the data transmission status, and then by using the resource demand to update the initial transmission resources allocated by the first bridge on the processor, it is possible to dynamically adjust the initial transmission resources according to the actual transmission resource demand of the bridge, avoid abnormal communication between the processor and the first terminal device due to insufficient resource allocation, and improve the utilization rate of the transmission resources allocated to the communication bus on the processor, avoid waste of transmission resources, solve the problem of low configuration efficiency of bus resources in the related art, and achieve the effect of improving the configuration efficiency of bus resources.
[0202] Optionally, the allocation module includes:
[0203] A prediction unit, configured to predict initial configuration information of each of the bridges according to the device information, wherein the initial configuration information is used to indicate the transmission resource requirements of the bridge for the communication bus in the current device connection state;
[0204] An allocating unit is used to control the processor to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information.
[0205] Optionally, the prediction unit is further used for:
[0206] Calculating a sum of target demand quantities of the first terminal devices connected to a plurality of the bridges to obtain a first resource quantity, wherein the device information includes the target demand quantity;
[0207] Subtracting the first amount of resources from the total amount of transmission resources configured by the processor for the communication bus to obtain a remaining amount of transmission resources;
[0208] Determining a second resource amount allocated to each of the bridges from the remaining amount of transmission resources;
[0209] The sum of the second resource amount and the corresponding target demand amount of the first terminal device connected to the bridge is determined as a candidate demand amount of the bridge for transmission resources of the communication bus, wherein the initial configuration information includes the candidate demand amount.
[0210] Optionally, the prediction unit is further used for:
[0211] Evenly divide the remaining amount of transmission resources according to the number of the bridges connected to the processor to obtain the second amount of resources for each bridge;
[0212] Calculate the sum of the target demand quantities of the first terminal devices connected to each of the bridges to obtain the third resource quantity of the transmission resources required by the bridge on the communication bus; allocate the remaining amount of transmission resources according to the ratio relationship between the third resource quantities of the bridges connected to the processor to obtain the second resource quantity of each bridge.
[0213] Optionally, the allocation unit is further used for:
[0214] Filtering out a second bridge to which transmission resources are currently to be allocated from a plurality of bridges according to the first priority of each of the bridges;
[0215] The initial transmission resource is allocated to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge, wherein the bus resource space includes transmission resources configured for the communication bus in the processor.
[0216] Optionally, the allocation unit is further used for:
[0217] Determine the starting address of the second bridge from the addresses of unoccupied transmission resources according to the sequence of resource addresses in the bus resource space;
[0218] Determine the end address of the second bridge in the bus resource space according to the candidate demand quantity with the start address as the starting point, wherein the candidate demand quantity is the quantity of transmission resources required by the second bridge on the communication bus, the initial configuration information includes the candidate demand quantity, and the quantity of resources between the start address and the end address is equal to the candidate demand quantity of the second bridge for transmission resources;
[0219] The transmission resources located between the start address and the end address in the bus resource space are determined as the initial transmission resources.
[0220] Optionally, the allocation unit is further used for:
[0221] Filtering, according to the second priority of the first terminal device connected to the second bridge, a reference terminal device to which transmission resources are currently to be allocated from the first terminal devices connected to the second bridge;
[0222] Select candidate transmission resources whose resource size matches the fourth resource amount of transmission resources required by the reference terminal device in the communication bus from the unoccupied transmission resources in the bus resource space, wherein the initial transmission resources include the candidate transmission resources corresponding to each of the first terminal devices in the second bridge, and the initial configuration information includes the fourth resource amount of each of the first terminal devices connected to the second bridge.
[0223] Optionally, the update module includes:
[0224] A first screening unit, configured to screen out a first transmission resource matching the resource requirement from the initial transmission resources configured for the third bridge in the processor, wherein the third bridge is a bridge other than the first bridge among the plurality of bridges;
[0225] An updating unit, configured to update the initial transmission resource using the first transmission resource.
[0226] Optionally, the first screening unit is used to:
[0227] Acquire a second transmission resource in the initial transmission resource configured for the third bridge that is in an unoccupied state;
[0228] A transmission resource in the second transmission resource whose resource amount matches the resource demand amount is determined as the first transmission resource.
[0229] Optionally, the prediction module includes:
[0230] A second screening unit, configured to screen out a second terminal device from the first terminal device connected to the first bridge, wherein the second terminal device is a terminal device connected to the first bridge and having a transmission resource expansion requirement;
[0231] A first determining unit is configured to determine the resource requirement according to a data transmission bandwidth between the second terminal device and the processor, wherein the data transmission status includes the data transmission bandwidth.
[0232] Optionally, the second screening unit is used to:
[0233] Filtering a third terminal device from the first terminal device connected to the first bridge, wherein the transmission resource demand of the third terminal device in the communication bus is a non-fixed value;
[0234] matching the data transmission bandwidth of each of the third terminal devices with a preset bandwidth threshold of the third terminal device, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the third terminal device and the processor in the communication bus;
[0235] When the data transmission bandwidth does not match the preset bandwidth threshold, the third terminal device is determined as the second terminal device.
[0236] Optionally, the first determining unit is configured to:
[0237] Calculate the difference between the data transmission bandwidth of each second terminal device and a preset bandwidth threshold of the second terminal device to obtain a first bandwidth value, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the second terminal device and the processor in the communication bus;
[0238] Calculate the sum of the first bandwidth values corresponding to the plurality of the second terminal devices to obtain a second bandwidth value;
[0239] The second bandwidth value is used to convert the resource requirement currently required by the first bridge.
[0240] Optionally, the device further includes:
[0241] a calculation module, configured to calculate a bandwidth and a value of a data transmission bandwidth of the first terminal device connected to the bridge after the data transmission status of each first terminal device in the communication bus is collected by the processor, wherein the data transmission bandwidth is used to indicate a data transmission status between the first terminal device and the processor through the communication bus, and the data transmission status includes the data transmission bandwidth;
[0242] The determination module is configured to determine the bridge as the first bridge when the transmission resource demand corresponding to the bandwidth and value is greater than the resource amount allowed to be used by the initial transmission resource configured by the bridge.
[0243] Optionally, the device further includes:
[0244] a sending module, configured to send a target detection instruction to the processor before predicting the initial configuration information of each of the bridges according to the device information, wherein the target detection instruction is used to instruct the processor to detect the first terminal device connected to each of the bridges and report the device identification of the first terminal device to the controller;
[0245] The first generating module is used to generate the device information for each first terminal device according to the device identification and the device information set when receiving the device identification reported by the processor, wherein the device information set records the transmission resource requirements of the terminal devices deployed on the server before the current moment in the communication bus.
[0246] Optionally, the first generating module includes:
[0247] an extraction unit, configured to extract from the device information set a plurality of reference demand quantities of the first terminal device corresponding to the device identifier, wherein the plurality of reference demand quantities are the transmission resource quantities required by the processor in the communication bus in a plurality of operation cycles before a current moment;
[0248] The second determining unit is used to determine the largest demand among the multiple reference demand quantities as the target demand quantity of the first terminal device, wherein the device information includes the target demand quantity.
[0249] Optionally, the device further includes:
[0250] a matching module, used for matching the device identification with the bridge information of the bridge before generating the device information for each first terminal device according to the device identification and the device information set, wherein the bridge information is used to indicate the identification of the device running on the bridge;
[0251] The second generating module is used to generate the device information for each first terminal device according to the device identification and the device information set when the device identification and the bridge information match each other.
[0252] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0253] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0254] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0255] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0256] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0257] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0258] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0259] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any one of the above method embodiments.
[0260] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0261] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0262] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for configuring bus resources, characterized in that: The server includes a processor, a controller and a plurality of bridges, each of the bridges is connected to a communication bus on the processor, the controller is connected to the processor, and the method is applied to the controller, including: During the startup of the processor, initial transmission resources are allocated to the bridge on the communication bus according to the device information of the first terminal device connected to each bridge; When the processor is in a running state, controlling the processor to collect a data transmission state of each first terminal device in the communication bus; In a case where the data transmission state is used to indicate that a first bridge exists among the plurality of bridges, predicting a current resource requirement of the first bridge according to the data transmission state, wherein the resource requirement is used to indicate the amount of transmission resources required to be used in addition to the initial transmission resources; The initial transmission resource allocated by the first bridge on the processor is updated according to the resource requirement.
2. The method according to claim 1, characterized in that The allocating initial transmission resources to the bridge on the communication bus according to the device information of the first terminal device connected to each bridge includes: Predicting initial configuration information of each of the bridges according to the device information, wherein the initial configuration information is used to indicate the transmission resource requirements of the bridge for the communication bus in the current device connection state; The processor is controlled to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information.
3. The method according to claim 2, characterized in that The predicting the initial configuration information of each bridge according to the device information includes: Calculating a sum of target demand quantities of the first terminal devices connected to a plurality of the bridges to obtain a first resource quantity, wherein the device information includes the target demand quantity; Subtracting the first amount of resources from the total amount of transmission resources configured by the processor for the communication bus to obtain a remaining amount of transmission resources; Determining a second resource amount allocated to each of the bridges from the remaining amount of transmission resources; The sum of the second resource amount and the corresponding target demand amount of the first terminal device connected to the bridge is determined as a candidate demand amount of the bridge for transmission resources of the communication bus, wherein the initial configuration information includes the candidate demand amount.
4. The method according to claim 3, characterized in that The determining of the second resource amount allocated to each bridge from the remaining amount of transmission resources comprises one of the following: Evenly divide the remaining amount of transmission resources according to the number of the bridges connected to the processor to obtain the second amount of resources for each bridge; Calculating the sum of the target demand quantities of the first terminal devices connected to each of the bridges to obtain a third resource quantity of the transmission resources required by the bridge on the communication bus; The remaining amount of transmission resources is allocated according to the ratio relationship between the third resource amounts of the bridges connected to the processor to obtain the second resource amount of each bridge.
5. The method according to claim 2, characterized in that: The controlling the processor to allocate the initial transmission resource to each bridge on the communication bus according to the initial configuration information comprises: Filtering out a second bridge to which transmission resources are currently to be allocated from a plurality of bridges according to the first priority of each of the bridges; The initial transmission resource is allocated to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge, wherein the bus resource space includes transmission resources configured for the communication bus in the processor.
6. The method according to claim 5, characterized in that The allocating the initial transmission resource to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge comprises: Determine the starting address of the second bridge from the addresses of unoccupied transmission resources according to the sequence of resource addresses in the bus resource space; Determine the end address of the second bridge in the bus resource space according to the candidate demand quantity with the start address as the starting point, wherein the candidate demand quantity is the quantity of transmission resources required by the second bridge on the communication bus, the initial configuration information includes the candidate demand quantity, and the quantity of resources between the start address and the end address is equal to the candidate demand quantity of the second bridge for transmission resources; The transmission resources located between the start address and the end address in the bus resource space are determined as the initial transmission resources.
7. The method according to claim 5, characterized in that The allocating the initial transmission resource to the second bridge in unoccupied transmission resources in a bus resource space according to the initial configuration information of the second bridge comprises: Filtering, according to the second priority of the first terminal device connected to the second bridge, a reference terminal device to which transmission resources are currently to be allocated from the first terminal devices connected to the second bridge; Select candidate transmission resources whose resource size matches the fourth resource amount of transmission resources required by the reference terminal device in the communication bus from the unoccupied transmission resources in the bus resource space, wherein the initial transmission resources include the candidate transmission resources corresponding to each of the first terminal devices in the second bridge, and the initial configuration information includes the fourth resource amount of each of the first terminal devices connected to the second bridge.
8. The method according to claim 1, characterized in that The updating of the initial transmission resource allocated by the first bridge on the processor according to the resource demand includes: Filtering out a first transmission resource matching the resource requirement from the initial transmission resources configured for the third bridge in the processor, wherein the third bridge is a bridge other than the first bridge among the plurality of bridges; The initial transmission resource is updated using the first transmission resource.
9. The method according to claim 8, characterized in that The step of selecting a first transmission resource matching the resource requirement from the initial transmission resources configured for the third bridge in the processor includes: Acquire a second transmission resource in the initial transmission resource configured for the third bridge that is in an unoccupied state; A transmission resource in the second transmission resource whose resource amount matches the resource demand amount is determined as the first transmission resource.
10. The method according to claim 1, characterized in that The predicting the current resource requirement of the first bridge according to the data transmission status includes: Filtering out a second terminal device from the first terminal device connected to the first bridge, wherein the second terminal device is a terminal device connected to the first bridge and having a transmission resource expansion requirement; The resource requirement is determined according to a data transmission bandwidth between the second terminal device and the processor, wherein the data transmission status includes the data transmission bandwidth.
11. The method according to claim 10, characterized in that The step of selecting a second terminal device from the first terminal devices connected to the first bridge includes: Filtering a third terminal device from the first terminal device connected to the first bridge, wherein the transmission resource demand of the third terminal device in the communication bus is a non-fixed value; matching the data transmission bandwidth of each of the third terminal devices with a preset bandwidth threshold of the third terminal device, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the third terminal device and the processor in the communication bus; When the data transmission bandwidth does not match the preset bandwidth threshold, the third terminal device is determined as the second terminal device.
12. The method according to claim 10, characterized in that The determining the resource requirement according to the data transmission bandwidth between the second terminal device and the processor includes: Calculate the difference between the data transmission bandwidth of each second terminal device and a preset bandwidth threshold of the second terminal device to obtain a first bandwidth value, wherein the preset bandwidth threshold is used to indicate a maximum data transmission bandwidth between the second terminal device and the processor in the communication bus; Calculate the sum of the first bandwidth values corresponding to the plurality of the second terminal devices to obtain a second bandwidth value; The second bandwidth value is used to convert the resource requirement currently required by the first bridge.
13. The method according to claim 1, characterized in that After controlling the processor to collect the data transmission status of each first terminal device in the communication bus, the method further includes: Calculating a bandwidth and value of a data transmission bandwidth of the first terminal device connected to the bridge, wherein the data transmission bandwidth is used to indicate a data transmission status between the first terminal device and the processor through the communication bus, and the data transmission status includes the data transmission bandwidth; In a case where the transmission resource demand corresponding to the bandwidth and value is greater than the resource amount allowed to be used by the initial transmission resource configured by the bridge, the bridge is determined as the first bridge.
14. The method according to claim 2, characterized in that Before predicting the initial configuration information of each bridge according to the device information, the method further includes: Sending a target detection instruction to the processor, wherein the target detection instruction is used to instruct the processor to detect the first terminal device connected to each of the bridges, and report the device identification of the first terminal device to the controller; When the device identification reported by the processor is received, the device information is generated for each first terminal device according to the device identification and the device information set, wherein the device information set records the transmission resource requirements of the terminal devices deployed on the server before the current moment in the communication bus.
15. The method according to claim 14, characterized in that Generating the device information for each first terminal device according to the device identifier and the device information set includes: Extracting multiple reference demand quantities of the first terminal device corresponding to the device identifier from the device information set, wherein the multiple reference demand quantities are the transmission resource quantities required by the processor in the communication bus in multiple operation cycles before the current moment; The largest demand among the multiple reference demands is determined as a target demand of the first terminal device, wherein the device information includes the target demand.
16. The method according to claim 14, characterized in that Before generating the device information for each first terminal device according to the device identifier and the device information set, the method further includes: Matching the device identification with bridge information of the bridge, wherein the bridge information is used to indicate an identification of a device running and connected on the bridge; In the case where the device identification and the bridge information match each other, the device information is generated for each first terminal device according to the device identification and the device information set.
17. A bus resource configuration device, characterized in that: The server includes a processor, a controller and a plurality of bridges, each of the bridges is connected to a communication bus on the processor, the controller is connected to the processor, the device is applied to the controller, and the device includes: an allocation module, configured to allocate initial transmission resources to the bridge on the communication bus according to device information of the first terminal device connected to each of the bridges during the process of controlling the processor to start; a control module, configured to control the processor to collect a data transmission status of each first terminal device in the communication bus when the processor is in a running state; a prediction module, configured to predict a current resource requirement of the first bridge according to the data transmission status when the data transmission status is used to indicate that a first bridge exists among the plurality of bridges, wherein the resource requirement is used to indicate a quantity of transmission resources required to be used in addition to the initial transmission resources; An updating module is used to update the initial transmission resource allocated by the first bridge on the processor according to the resource demand.
18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 16 when executed by a processor.
19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 16 are implemented.
20. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 16 are implemented.
Citation Information
Patent Citations
Resource allocation method, device and equipment and computer readable storage medium
CN112948310A
Bus resource reservation method and device, equipment and storage medium
CN114020344A