Server starting method and device, equipment and medium

By analyzing and filtering out unnecessary device drivers, generating a new root file system, loading and initializing the device drivers at the server startup, the problem of slow startup speed under different model configurations is solved, and a simplified and efficient server startup process is achieved.

CN119127336APending Publication Date: 2024-12-13INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411179557.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

During the server startup process, due to the differences in component models and versions on different models or configurations on servers, the generated initramfs image contains different drivers. When the system loads, each device driver needs to be identified and loaded, resulting in slow startup speed and lack of simplicity. An efficient way to start.

Method used

By analyzing the loading time and necessity of device drivers in the original root file system of the server operating system, unnecessary device drivers are filtered out, and a new root file system is generated, and the filtered device drivers are loaded and initialized when booting the kernel is started. , simplify the startup process and speed up the system startup.

Benefits of technology

By reducing unnecessary device driver loading, reducing system startup time, simplifying startup process, and reducing the risk of instability caused by resource occupation, improving system startup efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127336A_ABST
    Figure CN119127336A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a server starting method and device, equipment and a medium, and relates to the field of server starting. The method comprises the following steps: analyzing the loading time consumption and / or necessary degree of each equipment driver in an original root file system of an operating system of a server; according to an analysis result, filtering at least one device driver from the original root file system to obtain a new root file system; when a starting instruction for the operating system is detected, loading each device driver in the new root file system; and in the process of guiding and starting the kernel, the at least one filtered device driver is loaded, and initialization of each device driver is completed, so that more simplified and efficient server operation is realized, and the system starting efficiency and stability are greatly optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of server startup, and in particular to a server startup method, apparatus, device and medium. Background Art

[0002] When installing an operating system on a server, the operating system will generate an initramfs containing the current machine component drivers based on the current server hardware configuration by default. On servers of different models or configurations, due to differences in component models and versions, the drivers loaded by the system are also different, and the drivers contained in the generated initramfs image are also different.

[0003] Initramfs is a temporary file system running in memory at the beginning of system startup. It is responsible for detecting and identifying component devices on the server and loading device drivers required by the main user space file system. The initramfs generated by the current system generally contains all component drivers identified when the system is installed on the current server. At startup, it will identify and load the driver corresponding to each device according to the uevent mechanism, and then call init to initialize the kernel. The system startup speed is slow, and operators need a more simplified and efficient server startup method. Summary of the invention

[0004] Based on the above technical problems, the embodiments of the present application provide a server startup method, apparatus, device and medium, aiming to simplify and efficiently start the server.

[0005] A first aspect of an embodiment of the present application provides a server startup method, the method comprising:

[0006] Analyze the loading time and / or necessity of each device driver in the original root file system of the server's operating system;

[0007] According to the analysis result, at least one device driver is filtered out from the original root file system to obtain a new root file system;

[0008] When a startup instruction for the operating system is detected, each device driver in the new root file system is loaded;

[0009] In the process of booting the kernel, the at least one device driver that is filtered out is loaded to complete the initialization of each device driver.

[0010] Optionally, analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system includes: acquiring the shape information and the location information;

[0011] During the first booting of the operating system, adding kernel parameters to the kernel boot command line;

[0012] Before calling the initialization function of each device driver in the original root file system, printing a first system startup log record, wherein the first system startup log record represents the called device driver;

[0013] After calling the initialization function of each device driver in the original root file system, printing a second system startup log record, wherein the second system startup log record includes the execution time of the initialization function of the called device driver;

[0014] The time taken for the initialization function of each device driver to run is determined as the loading time of the device driver.

[0015] Optionally, according to the analysis result, filtering out at least one device driver from the original root file system to obtain a new root file system includes:

[0016] Compare the loading time of each device driver in the original root file system with a preset value respectively;

[0017] One or more device drivers whose loading time exceeds the preset value are filtered out.

[0018] Optionally, filtering out at least one device driver from the original root file system according to the analysis result includes:

[0019] The driver corresponding to the PCIE external device is filtered out from the original root file system, and the driver corresponding to the PCIE external device includes at least one of the following: a network card driver, a Raid card driver, a SAS card driver, and an HBA card driver.

[0020] Optionally, filtering out at least one device driver from the original root file system according to the analysis result includes:

[0021] Compare the loading time of each device driver in the original root file system with a preset value respectively;

[0022] Adding multiple device drivers whose loading time exceeds the preset value to the device driver list;

[0023] Device drivers that do not need to be loaded are determined from the device driver list and added to the blacklist.

[0024] Optionally, in the process of booting the kernel, loading the at least one device driver that is filtered out and completing the initialization of each device driver includes:

[0025] Encapsulate the device drivers in the blacklist as a boot-up automatic service;

[0026] In the process of booting the kernel, the boot-up self-starting service is executed to load the at least one device driver that has been filtered out, and complete the initialization of each device driver.

[0027] Optionally, when a startup instruction for the operating system is detected, each device driver in the new root file system is loaded, including:

[0028] When a startup instruction for the operating system is detected, the device drivers in the new root file system are loaded, and the device drivers in the new root file system at least include: drivers corresponding to the system root directory disk, drivers corresponding to input devices, and device drivers whose loading time is less than a preset value.

[0029] Optionally, in the process of booting the kernel, loading the at least one device driver that is filtered out and completing the initialization of each device driver includes:

[0030] After the new root file system is loaded, when starting the kernel and user space related services, the boot-up service is executed to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

[0031] A second aspect of an embodiment of the present application provides a server startup device, the device comprising:

[0032] An analysis module, used for analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system;

[0033] A root file system generation module, used to filter out at least one device driver from the original root file system according to the analysis result to obtain a new root file system;

[0034] A first loading module, configured to load each device driver in the new root file system when a startup instruction for the operating system is detected;

[0035] The second loading module is used to load the at least one device driver that is filtered out during the process of booting the kernel, and complete the initialization of each device driver.

[0036] Optionally, the analysis module includes:

[0037] A kernel parameter determination submodule, used to add kernel parameters to the kernel startup command line during the first startup of the operating system;

[0038] A first system startup log record submodule, used for printing a first system startup log record before calling the initialization function of each device driver in the original root file system, wherein the first system startup log record represents the called device driver;

[0039] A second system startup log recording submodule is used to print a second system startup log record after calling the initialization function of each device driver in the original root file system, wherein the second system startup log record includes the execution time of the called device driver initialization function;

[0040] The loading time generation submodule is used to determine the running time of the initialization function of each device driver as the loading time of the device driver.

[0041] Optionally, the root file system generation module includes:

[0042] A comparison submodule, used to compare the loading time of each device driver in the original root file system with a preset value;

[0043] The device filtering submodule is used to filter out one or more device drivers whose loading time exceeds the preset value.

[0044] Optionally, the root file system generation module includes:

[0045] The external device filtering submodule is used to filter the driver corresponding to the PCIE external device from the original root file system, and the driver corresponding to the PCIE external device includes at least one of the following: network card driver, Raid card driver, SAS card driver, HBA card driver.

[0046] Optionally, the root file system generation module includes:

[0047] A loading time comparison submodule, used to compare the loading time of each device driver in the original root file system with a preset value;

[0048] A device driver list generation submodule, used for adding a plurality of device drivers whose loading time exceeds the preset value to the device driver list;

[0049] The blacklist generation submodule is used to determine the device drivers that are not necessary to load from the device driver list and add them to the blacklist.

[0050] Optionally, the root file system generation module includes:

[0051] A boot-up self-start service generation submodule is used to encapsulate the device drivers in the blacklist as a boot-up self-start service;

[0052] The boot-up self-start service execution submodule is used to execute the boot-up self-start service in the process of booting the kernel to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

[0053] Optionally, the first loading module further includes:

[0054] The root file system loading submodule is used to load the device drivers in the new root file system when a startup instruction for the operating system is detected. The device drivers in the new root file system at least include: drivers corresponding to the system root directory disk, drivers corresponding to input devices, and device drivers whose loading time is less than a preset value.

[0055] Optionally, the second loading module further includes:

[0056] The device driver initialization submodule is used to execute the boot-up service when starting the relevant services of the kernel and user space after loading the new root file system, so as to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

[0057] Optionally, the root file system generation module further includes:

[0058] A first target measurement item acquisition submodule, used to obtain the first target measurement item of the nth startup, where n is an integer greater than 1;

[0059] A first root file system determination submodule, configured to add a device driver of the first target measurement item to the new root file system to obtain a first root file system;

[0060] A first device driver loading submodule, configured to load each device driver in the first root file system when a startup instruction for the operating system is detected;

[0061] A first device driver initialization submodule, used for loading the at least one device driver that is filtered out during the process of booting the kernel, and completing the initialization of each device driver;

[0062] A second target measurement item acquisition submodule, used to obtain the second target measurement item started for the (n+1)th time;

[0063] a second root file system determination submodule, configured to filter out the device driver of the first target measurement item from the first root file system, and add the device driver of the second target measurement item to the new root file system to obtain a second root file system;

[0064] A second device driver loading submodule, configured to load each device driver in the second root file system when a startup instruction for the operating system is detected;

[0065] The second device driver initialization submodule is used to load the at least one device driver that is filtered out and the device driver of the first target measurement item during the process of booting the kernel, and complete the initialization of each device driver.

[0066] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the server startup method of the first aspect of the embodiment of the present application is implemented.

[0067] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the server startup method of the first aspect of the embodiment of the present application is implemented.

[0068] Through the server startup method of the embodiment of the present application, the loading time and / or necessity of each device driver in the original root file system of the server's operating system is analyzed; according to the analysis result, at least one device driver is filtered out from the original root file system to obtain a new root file system; when a startup instruction for the operating system is detected, each device driver in the new root file system is loaded; in the process of booting the kernel, the at least one device driver that has been filtered out is loaded to complete the initialization of each device driver.

[0069] In this embodiment, the present application analyzes the loading time and / or necessity of each device driver in the original root file system, filters out a part of the device drivers from the original root file system, and obtains a new root file system. By first loading the new root file system and then loading the filtered device drivers during the process of booting the kernel, the system startup speed is accelerated, the startup process is simplified, and the risk of failing to start normally due to unstable factors during the system startup process is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0071] Figure 1is a flow chart of a server startup method shown in an embodiment of the present application;

[0072] Figure 2 It is a structural block diagram of a server startup device shown in an embodiment of the present application;

[0073] Figure 3 It is a schematic diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0075] Please refer to Figure 1 , Figure 1 This is a flow chart of a server startup method of the present application. Figure 1 As shown, the method may include steps S101 to S104:

[0076] Step S101: analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system;

[0077] Step S102: According to the analysis result, at least one device driver is filtered out from the original root file system to obtain a new root file system;

[0078] Step S103: when a startup instruction for the operating system is detected, each device driver in the new root file system is loaded;

[0079] Step S104: during the process of booting the kernel, the at least one device driver that is filtered out is loaded to complete the initialization of each device driver.

[0080] In this embodiment, it is considered that in the initramfs temporary file system at the initial stage of system startup, it is not necessary to load each identified device driver module on the server, because these device driver modules can be loaded and initialized in the real kernel booted by initramfs later. Considering that in the process of system startup, do not load too many unnecessary driver modules, especially driver modules corresponding to PCIE external devices such as network cards, Raid cards, Sas cards, HBA cards, etc., their loading time occupies most of the system startup time. This will not only slow down the startup speed of the system, but also, the more driver modules loaded and the longer it takes, the more likely it is that unstable factors will appear, causing the system to fail to start. Therefore, the present application proposes to analyze the loading time and / or necessity of each device driver in the original root file system, and filter out a part of the device drivers from the original root file system according to the analysis results to obtain a new root file system, thereby simplifying the startup process; then, when the operating system startup instruction is obtained, the device drivers in the new root file system are loaded first, so that the system can be quickly started; finally, after the system startup is completed, the above-mentioned filtered device drivers are loaded again during the process of booting the kernel, thereby completing all the initialization of each device driver, avoiding the loading of time-consuming device drivers during the system startup process, reducing the resource usage during the system startup, reducing the possibility of the system failing to start normally, and greatly optimizing the efficiency and stability of the system startup.

[0081] Step S101: analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system.

[0082] In this embodiment, the operating system automatically obtains corresponding device drivers according to all devices connected to the server when the system is installed. The original root file system contains various device drivers. During the system startup process, each device driver needs to be initialized and loaded.

[0083] The loading time refers to the total time required for each device driver from the beginning of loading to the completion of loading. Since a large number of device drivers need to be loaded when the system starts, if a device driver takes too long to load, it will slow down the startup time of the entire system. In addition, a longer loading time means more resource usage. During the system startup process, a large number of device drivers need to be initialized and loaded. Excessive resource usage may cause instability, resulting in abnormal device initialization and the system cannot start normally.

[0084] The degree of necessity is used to consider whether the loading of a device driver will affect the system startup. For example, if the driver module corresponding to the system root directory disk is not loaded, the system root directory disk cannot be called, resulting in the system being unable to start, so its degree of necessity is essential; if the device driver of input devices such as keyboards and mice is not loaded, subsequent operations on the server cannot be performed, so its degree of necessity is essential; if the device driver corresponding to the network card is not loaded, it will only affect the communication with other devices, but will not affect the normal startup of the system, so its degree of necessity is non-essential. The above examples are only for the purpose of illustrating the degree of necessity, and the actual situation should prevail during actual operation.

[0085] Furthermore, in one embodiment, the degree of necessity also includes consideration of the purpose of the startup. For example, if the purpose of a startup is to test the startup of a network card driver module, then the degree of necessity of the network card driver is essential. The above example is only for the purpose of illustrating the degree of necessity. The actual situation should prevail in the actual operation process.

[0086] Step S102: According to the analysis result, at least one device driver is filtered out from the original root file system to obtain a new root file system.

[0087] In this embodiment, the analysis result includes the analysis result of the loading time consumption and the analysis result of the necessity in step S101, and subsequent operations should be based on at least these two conditions; filtering out at least one device driver means removing the device driver from the original root file system, so that the new root file system does not include the filtered device driver.

[0088] In this embodiment, a comprehensive consideration is made based on the loading time and necessity of the device drivers, and the device drivers that are deemed to take a long time to load and are not necessary are filtered out, thereby achieving the purpose of accelerating the system startup speed and simplifying the system startup process.

[0089] Step S103: when a startup instruction for the operating system is detected, each device driver in the new root file system is loaded.

[0090] In this embodiment, after obtaining the new root file system in the above steps, the root file system that needs to be loaded in the subsequent startup process can be selected, that is: it can be started through the original root file system and all device drivers can be loaded during the system startup process, or it can be started according to the new root file system and a part of the filtered device drivers can be loaded first during the system startup process.

[0091] Furthermore, the user can set different new root file systems according to different usage requirements, and after the server is completely started, the user can still customize the root file system to be loaded at the next startup.

[0092] Step S104: during the process of booting the kernel, loading the at least one device driver that has been filtered out, and completing the initialization of each device driver;

[0093] In this embodiment, the device driver that is filtered out is still the device driver required for normal use of the server, so it is necessary to load the device driver that is filtered out during the process of booting the kernel after the system is started. In an optional embodiment, after obtaining the device driver that is filtered out, it can be encapsulated as a boot-up service, and the boot-up service is executed during the process of booting the kernel to complete the initialization of each device driver.

[0094] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S101 specifically further includes the following contents:

[0095] First, during the first booting of the operating system, kernel parameters are added to the kernel booting command line.

[0096] In this embodiment, the kernel parameter is used to measure the loading time of each device driver. By adding the kernel parameter initcall_debug in the kernel startup command line, the loading time of each device driver can be measured and printed during the first startup of the operating system.

[0097] Then, before calling the initialization function of each device driver in the original root file system, a first system startup log record is printed, wherein the first system startup log record represents the called device driver.

[0098] In this embodiment, after adding the kernel parameter initcall_debug to the kernel startup command line, a log will be added during the startup process. Before each device driver is initialized and loaded, the first print of the device driver will be made in the log, indicating that the initialization loading of the device driver is in progress.

[0099] Next, after calling the initialization function of each device driver in the original root file system, a second system startup log record is printed, wherein the second system startup log record includes the execution time of the called initialization function of the device driver.

[0100] In this embodiment, after the initialization record of a certain device driver is completed, the kernel parameter initcall_debug will print a second record of the device driver in the log, indicating the time taken for the initialization loading of the device driver.

[0101] Finally, the running time of the initialization function of each device driver is determined as the loading time of the device driver.

[0102] In this embodiment, after completing the two prints of the above-mentioned device driver, the information of the running time of the initialization function of the device driver can be obtained, and the running time of the initialization function is determined as the loading time of the device driver, recorded in the log, and used to screen the device drivers in subsequent steps.

[0103] In this application, the above steps are further described in detail by taking the content printed in the log of a part of the kernel parameter initcall_debug as an example, as follows:

[0104] calling igb_init_module+0x0 / 0x1000[igb]@900

[0105] initcall igb_init_module+0x0 / 0x1000[igb]returned 0after 119743usecs

[0106] calling init_scsi+0x0 / 0x7a[scsi_mod]@908

[0107] initcall init_scsi+0x0 / 0x7a[scsi_mod]returned 0after 19326usecs

[0108] calling phy_init+0x0 / 0x2bb[libphy]@927

[0109] initcall phy_init+0x0 / 0x2bb[libphy]returned 0after 10usecs

[0110] calling xhci_pci_init+0x0 / 0x1000[xhci_pci]@901

[0111] initcall xhci_pci_init+0x0 / 0x1000[xhci_pci]returned 0after 2685usecs

[0112] calling nvme_core_init+0x0 / 0xb77[nvme_core]@902

[0113] initcall nvme_core_init+0x0 / 0xb77[nvme_core]returned 0after 210usecs

[0114] calling ixgbe_init_module+0x0 / 0x1000[ixgbe]@927

[0115] initcall ixgbe_init_module+0x0 / 0x1000[ixgbe]returned 0after4153703usecs

[0116] Taking the network card driver igb as an example, the content of the first line in the above log is the first system startup log record of the network card driver igb, indicating that the network card driver igb starts to start and is the 900th device driver started during this startup process; the content of the second line in the above log is the second system startup log record of the network card driver igb, indicating that the network card driver igb takes a total of 119743 microseconds from the start of initialization loading to the completion of loading. In this embodiment, 119743 microseconds is determined as the loading time of the network card driver igb.

[0117] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S102 specifically further includes the following contents:

[0118] First, the loading time of each device driver in the original root file system is compared with a preset value.

[0119] After obtaining the loading time of each device driver in the above step S101, it is also necessary to distinguish the device drivers with different loading times, and the distinction standard is the preset value. In the actual server startup operation process, there are generally many device drivers that need to be initialized and loaded, about hundreds to thousands, among which the loading time of most device drivers is a relatively small value, within the user's acceptable range, and does not need to be filtered out, while a small number of device drivers have a long loading time, so a preset value for comparison with the loading time is needed, and the various device drivers are divided into a set of shorter loading times and a set of longer loading times, wherein the specific size of the preset value can be set according to user needs.

[0120] Then, one or more device drivers whose loading time exceeds the preset value are filtered out.

[0121] After the preset value is determined according to user needs and the loading time is compared with the preset value, the device drivers need to be filtered out according to the above comparison results, and the device drivers whose loading time is greater than the preset value are filtered out, and the device drivers whose loading time is less than the preset value are retained to achieve the purpose of speeding up the startup speed.

[0122] Taking the above log content as an example, assuming that the preset value is 100ms, comparing the loading time of the above device drivers with 100ms, we can find that the device drivers whose loading time is less than the preset value include: scsi_mod, libphy, xhci_pci and nvme_core; the device drivers whose loading time is greater than the preset value include: igb, ixgbe. Therefore, igb and ixgbe are filtered out in the original root file system.

[0123] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S102 specifically further includes the following contents:

[0124] The driver corresponding to the PCIE external device is filtered out from the original root file system, and the driver corresponding to the PCIE external device includes at least one of the following: a network card driver, a Raid card driver, a SAS card driver, and an HBA card driver.

[0125] PCIE is a high-speed serial point-to-point dual-channel high-bandwidth transmission method. The external devices usually take a long time to load, and the loading time usually takes up most of the system startup time. Therefore, the device drivers filtered out in the original root file system need to at least include the device drivers corresponding to the PCIE external devices.

[0126] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S102 specifically further includes the following contents:

[0127] First, the loading time of each device driver in the original root file system is compared with a preset value, and a plurality of device drivers whose loading time exceeds the preset value are added to a device driver list.

[0128] In the above steps, after obtaining the comparison result of the loading time of each device driver with the preset value, it is necessary to filter out the device drivers whose loading time exceeds the preset value. However, in the actual operation process, the devices corresponding to the filtered device drivers still need to work after the server starts normally. Therefore, multiple device drivers whose loading time exceeds the preset value are added to a device driver list, and the device driver list is used to count the device drivers that are filtered out according to the loading time.

[0129] Taking the above log content as an example, after comparing the loading time with the preset value, igb and ixgbe are added to the device driver list.

[0130] Then, the device drivers that are not necessary to be loaded are determined from the device driver list and added to the blacklist.

[0131] According to the content described in step S101, the necessity of the device driver is analyzed according to user needs. The loading of the non-essential device driver described in the analysis result does not affect the normal startup of the system. Therefore, based on the comprehensive consideration of the loading time and necessity, the device drivers added to the device driver list will be classified again according to their necessity, wherein the device drivers that must be loaded are added to the new root file system, and the unnecessary device drivers are added to the blacklist. The blacklist is used to represent a collection of device drivers that take more time to load than a preset value and are unnecessary.

[0132] Taking the above log content as an example, during the secondary screening of the device driver list, if the network card driver igb is the target that the user needs to perform a startup test later, igb is added to the new root file system, and the unnecessary ixgbe is added to the blacklist.

[0133] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the step of adding the device driver to the blacklist list specifically includes the following contents:

[0134] First, the device drivers in the blacklist are packaged as a boot-up automatic service.

[0135] Since the device drivers in the blacklist are still needed after the server is normally started, they still need to be initialized and loaded. Therefore, they are encapsulated as the boot-up self-starting service to perform the initialization loading operation.

[0136] In this embodiment, the device drivers in the blacklist are encapsulated into the system systemd boot-up service loadmodules.service to initialize and load the device drivers therein.

[0137] Then, in the process of booting the kernel, the boot-up self-starting service is executed to load the at least one device driver that has been filtered out, and complete the initialization of each device driver.

[0138] After the system is started, in the process of booting the kernel, the device drivers in the blacklist that have been packaged as the boot-up service are initialized and loaded, thereby completing the initialization loading of all the device drivers described in the server.

[0139] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S103 specifically further includes the following contents:

[0140] First, when a startup instruction for the operating system is detected, the device drivers in the new root file system are loaded, and the device drivers in the new root file system at least include: drivers corresponding to the system root directory disk, drivers corresponding to input devices, and device drivers that take less time to load than a preset value.

[0141] After completing the settings of the new root file system and the boot-up service, when the boot operation is performed, after obtaining the boot instruction for the operating system, the loaded root file system is the new root file system, wherein the device drivers for initial loading include: necessary device drivers and device drivers whose loading time is less than the preset value. Among them, the necessary device drivers at least include the drivers corresponding to the root directory disk and the drivers corresponding to the input devices. Optionally, the necessary device drivers can also include device drivers related to the purpose of this boot, such as the purpose of a certain boot is for the startup test of the network card driver module, then the network card driver is a necessary device driver.

[0142] Then, in the process of booting the kernel, the at least one device driver that has been filtered out is loaded, and the initialization of each device driver is completed, including: after the new root file system is loaded, when starting the kernel and related services of the user space, the boot-up service is executed to load the at least one device driver that has been filtered out, and the initialization of each device driver is completed.

[0143] After the server completes the startup of the root file system, it needs to start the kernel and related user space services. Since some device drivers are filtered out in the new root file system, and these device drivers will also be needed during the normal operation of the server, in the process of starting the kernel and related user space services, the filtered device drivers are initialized and loaded through the packaged boot-up service. In this way, all the device drivers in the server are initialized.

[0144] In combination with the above embodiments, in one implementation, the present application further provides a server startup method, in which the above step S102 specifically further includes the following contents:

[0145] First, a first target measurement item of the n-th startup is obtained, where n is an integer greater than 1.

[0146] In the embodiment of the present application, since the device drivers that take a long time to load are filtered out, the server startup method can be used in test projects that require multiple server startup operations. During the test of a certain device, the device can be determined as the first target measurement item.

[0147] Then, the device driver of the first target measurement item is added to the new root file system to obtain a first root file system.

[0148] In an embodiment of the present application, since it is necessary to test the device of the first target measurement item, the device driver corresponding to the first target measurement item needs to be initialized and loaded during the system startup process. The device driver can be manually added to the root file system to obtain the first root file system including the device driver in the original root file system and the device driver corresponding to the first target measurement item.

[0149] For example, taking the above log content as an example, if the first target measurement item is the network card during the nth startup, the corresponding device driver igb is the device driver that needs to be initialized and loaded during the system startup process. Therefore, igb is added to the original root file system to obtain a new first root file system containing igb.

[0150] Next, when a startup instruction for the operating system is detected, each device driver in the first root file system is loaded, and in the process of booting the kernel, the at least one device driver that is filtered out is loaded to complete the initialization of each device driver.

[0151] In the embodiment of the present application, after obtaining the startup instruction for the operating system, the various device drivers contained in the first root file system are first loaded during the system startup process according to the first root file system, and then other device drivers that are filtered out are loaded during the process of booting the kernel, and the initialization of all device drivers has been completed.

[0152] In an optional embodiment, the process of booting the device driver may not require kernel loading. Therefore, after the system startup is completed and the device drivers contained in the first root file system are loaded, the next startup process can be performed. In this way, device drivers that take a long time to start are filtered out, which speeds up the system startup speed and improves the test efficiency. The improvement is particularly significant in scenarios where a large number of repeated startup tests are required.

[0153] Next, a second target measurement item for the (n+1)th startup is obtained, a device driver of the first target measurement item is filtered out from the first root file system, and the device driver of the second target measurement item is added to the new root file system to obtain a second root file system.

[0154] In the embodiment of the present application, the root file system can be modified multiple times. When the second target test item needs to be tested, the device driver in the root file system can be modified to filter out the device driver that takes a long time to load in the existing first root file system, and the device driver corresponding to the second target test item that needs to be tested is added to the new root file system to obtain a new second root file system.

[0155] For example, taking the above log content as an example, if after completing the test of the first target measurement item network card device, you need to test the second target measurement item high-speed network card device, then you need to filter out the network card driver igb that takes a long time to load from the root file system, and add the device driver ixgbe corresponding to the high-speed network card to the root file system to obtain a new second root file system.

[0156] Finally, when a startup instruction for the operating system is detected, each device driver in the second root file system is loaded, and during the process of booting the kernel, the at least one device driver that is filtered out and the device driver of the first target measurement item are loaded to complete the initialization of each device driver.

[0157] In the embodiment of the present application, after obtaining the startup instruction for the operating system, first, during the system startup process, various device drivers contained in the second root file system are loaded according to the second root file system, and then during the process of booting the kernel, other device drivers that are filtered out, as well as the device driver of the first target measurement item that is filtered out in the above steps, are loaded to complete the initialization of all device drivers.

[0158] Based on the same design concept, an embodiment of the present application provides a server startup device. Figure 2 , Figure 2 1 is a structural block diagram of a server startup device provided in an embodiment of the present application. Figure 2 As shown, the device comprises:

[0159] An analysis module, used for analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system;

[0160] A root file system generation module, used to filter out at least one device driver from the original root file system according to the analysis result to obtain a new root file system;

[0161] A first loading module, configured to load each device driver in the new root file system when a startup instruction for the operating system is detected;

[0162] The second loading module is used to load the at least one device driver that is filtered out during the process of booting the kernel, and complete the initialization of each device driver.

[0163] Optionally, the analysis module includes:

[0164] A kernel parameter determination submodule, which adds kernel parameters to a kernel startup command line during the first startup of the operating system;

[0165] A first system startup log recording submodule, which prints a first system startup log record before calling the initialization function of each device driver in the original root file system, wherein the first system startup log record represents the called device driver;

[0166] A second system startup log recording submodule, after calling the initialization function of each device driver in the original root file system, prints a second system startup log record, wherein the second system startup log record includes the execution time of the called device driver initialization function;

[0167] The loading time-consuming generation submodule determines the running time of the initialization function of each device driver as the loading time-consuming of the device driver.

[0168] Optionally, the root file system generation module includes:

[0169] A comparison submodule compares the loading time of each device driver in the original root file system with a preset value;

[0170] The device filtering submodule filters out one or more device drivers whose loading time exceeds the preset value.

[0171] Optionally, the root file system generation module includes:

[0172] The external device filtering submodule filters the driver corresponding to the PCIE external device from the original root file system, and the driver corresponding to the PCIE external device includes at least one of the following: a network card driver, a Raid card driver, a SAS card driver, and an HBA card driver.

[0173] Optionally, the root file system generation module includes:

[0174] A loading time comparison submodule compares the loading time of each device driver in the original root file system with a preset value;

[0175] A device driver list generation submodule is configured to add a plurality of device drivers whose loading time exceeds the preset value to the device driver list;

[0176] The blacklist generation submodule determines the device drivers that are not necessary to be loaded from the device driver list and adds them to the blacklist.

[0177] Optionally, the root file system generation module includes:

[0178] A boot-up self-starting service generation submodule encapsulates the device drivers in the blacklist as a boot-up self-starting service;

[0179] The boot-up self-start service execution submodule executes the boot-up self-start service during the process of booting the kernel to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

[0180] Optionally, the first loading module further includes:

[0181] The root file system loading submodule loads the device drivers in the new root file system when a startup instruction for the operating system is detected. The device drivers in the new root file system include at least: drivers corresponding to the system root directory disk, drivers corresponding to input devices, and device drivers whose loading time is less than a preset value.

[0182] Optionally, the second loading module further includes:

[0183] The device driver initialization submodule executes the boot-up service when starting the kernel and user space related services after loading the new root file system to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

[0184] Based on the same design concept, another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the server startup method described in any of the above embodiments of the present application are implemented.

[0185] Based on the same design concept, another embodiment of the present application provides an electronic device, such as Figure 3 shown. Figure 3 This is a schematic diagram of an electronic device shown in an embodiment of the present application. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes, the steps in the server startup method described in any of the above embodiments of the present application are implemented.

[0186] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0188] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0189] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0190] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0191] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0192] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0193] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0194] The above is a detailed introduction to a server startup method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A server startup method, include: Analyze the loading time and / or necessity of each device driver in the original root file system of the server's operating system; According to the analysis result, at least one device driver is filtered out from the original root file system to obtain a new root file system; When a startup instruction for the operating system is detected, each device driver in the new root file system is loaded; In the process of booting the kernel, the at least one device driver that is filtered out is loaded to complete the initialization of each device driver.

2. A server startup method according to claim 1, It is characterized in that The method further comprises: During the first booting of the operating system, adding kernel parameters to the kernel boot command line; Before calling the initialization function of each device driver in the original root file system, printing a first system startup log record, wherein the first system startup log record represents the called device driver; After calling the initialization function of each device driver in the original root file system, printing a second system startup log record, wherein the second system startup log record includes the execution time of the initialization function of the called device driver; The time taken for the initialization function of each device driver to run is determined as the loading time of the device driver.

3. A server startup method according to claim 1, It is characterized in that According to the analysis result, filtering out at least one device driver from the original root file system includes: Compare the loading time of each device driver in the original root file system with a preset value respectively; One or more device drivers whose loading time exceeds the preset value are filtered out.

4. A server startup method according to claim 1, It is characterized in that According to the analysis result, filtering out at least one device driver from the original root file system includes: The driver corresponding to the PCIE external device is filtered out from the original root file system, and the driver corresponding to the PCIE external device includes at least one of the following: a network card driver, a Raid card driver, a SAS card driver, and an HBA card driver.

5. A server startup method according to claim 1, It is characterized in that According to the analysis result, filtering out at least one device driver from the original root file system includes: Compare the loading time of each device driver in the original root file system with a preset value respectively; Adding multiple device drivers whose loading time exceeds the preset value to the device driver list; Device drivers that do not need to be loaded are determined from the device driver list and added to the blacklist.

6. A server startup method according to claim 5, It is characterized in that In the process of booting the kernel, loading the at least one device driver that is filtered out and completing the initialization of each device driver includes: Encapsulate the device drivers in the blacklist as a boot-up automatic service; In the process of booting the kernel, the boot-up self-starting service is executed to load the at least one device driver that has been filtered out, and complete the initialization of each device driver.

7. A server startup method according to claim 1, It is characterized in that When a startup instruction for the operating system is detected, each device driver in the new root file system is loaded, including: When a startup instruction for the operating system is detected, the device drivers in the new root file system are loaded, wherein the device drivers in the new root file system at least include: a driver corresponding to a system root directory disk, a driver corresponding to an input device, and a device driver whose loading time is less than a preset value; In the process of booting the kernel, loading the at least one device driver that is filtered out and completing the initialization of each device driver includes: After the new root file system is loaded, when starting the kernel and user space related services, the boot-up service is executed to load the at least one device driver that has been filtered out and complete the initialization of each device driver.

8. A server startup method according to claim 1, It is characterized in that The method further comprises: Obtaining the first target measurement item of the nth startup, where n is an integer greater than 1; Adding a device driver for the first target measurement item to the new root file system to obtain a first root file system; When a startup instruction for the operating system is detected, each device driver in the first root file system is loaded; In the process of booting the kernel, loading the at least one device driver that is filtered out, and completing the initialization of each device driver; Obtain the second target measurement item for the (n+1)th start; filtering out the device driver of the first target measurement item from the first root file system, and adding the device driver of the second target measurement item to the new root file system to obtain a second root file system; When a startup instruction for the operating system is detected, each device driver in the second root file system is loaded; During the process of booting the kernel, the at least one device driver that is filtered out and the device driver of the first target measurement item are loaded to complete the initialization of each device driver.

9. A server startup device, It is characterized in that The device comprises: An analysis module, used for analyzing the loading time and / or necessity of each device driver in the original root file system of the server's operating system; A root file system generation module, used to filter out at least one device driver from the original root file system according to the analysis result to obtain a new root file system; A first loading module, configured to load each device driver in the new root file system when a startup instruction for the operating system is detected; The second loading module is used to load the at least one device driver that is filtered out during the process of booting the kernel, and complete the initialization of each device driver.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the computer program is executed by the processor, the server startup method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the server startup method according to any one of claims 1 to 8 is implemented.