Method and device for managing disk array, equipment and program product

By creating the domain path of the disk group in the first core of the processor and sending notification messages, the problem of mismatch between the creation time of the volume management device and the device management driver is solved, and the correct creation of the disk array and the normal startup of the operating system is achieved.

CN119937918AActive Publication Date: 2025-05-06LENOVO (BEIJING) LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411958649.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-06
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

When the volume management device in the processor manages a redundant array of independent disks, the path creation time does not match the time when the device management driver creates a RAID, resulting in error reporting and affecting the startup and operation of the operating system.

Method used

By creating a corresponding domain path for the target disk group by the first program running in the first kernel, and when the domain path is determined to be completed, a notification message is sent to the volume management driver, and then notifying the disk driver for scanning, ultimately, the device management program completes the creation of the disk array.

Benefits of technology

It realizes timing matching during disk array creation, avoids error reporting, and ensures the normal startup and operation of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937918A_ABST
    Figure CN119937918A_ABST
Patent Text Reader

Abstract

The invention discloses a disk array management method and device, equipment and a program product, and the method comprises the steps that a first program operated in a first kernel creates a corresponding domain path for a target group of disks, and in the case that it is determined that the creation of the domain path is completed, the target group of disks is stored in the first kernel; sending a first notification message to a volume management driver running in the first kernel; the volume management drive program responds to the first notification message and sends second notification information to a disk drive program running in a second kernel, and the second notification information is used for notifying the disk drive program to scan; the disk drive program responds to the second notification information, and under the condition that scanning of the target disk pack is completed, third notification information is sent to an equipment management program running in a third kernel, so that the equipment management program responds to the third notification information, and creation of a disk array corresponding to the target disk pack is completed.
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 electronic technology, and relate to but are not limited to a disk array management method, device, equipment, and program product. Background Art

[0002] When a volume management device (VMD) in a processor manages a redundant array of independent disks (RAID), there is a problem that the timing of path creation does not match the timing of RAID creation by a device management driver.

[0003] When VMD reports the Non-Volatile Memory Express (NVMe) driver to the Userspace device manager (Udev), the device manager checks the path corresponding to the redundant array of disks. However, the VMD driver may not have completed the creation of the path at this time. In this case, an error is reported, further affecting the startup and operation of the operating system. Summary of the invention

[0004] In view of this, embodiments of the present application provide a disk array management method, apparatus, device, and program product.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a disk array management method, comprising:

[0007] The first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel when it is determined that the creation of the domain path is completed;

[0008] The volume management driver sends a second notification message to the disk driver running in the second kernel in response to the first notification message, wherein the second notification message is used to notify the disk driver to perform scanning;

[0009] In response to the second notification information, the disk driver sends a third notification information to the device management program running in the third kernel when the target disk group is scanned, so that the device management program completes the creation of the disk array corresponding to the target disk group in response to the third notification information.

[0010] In a second aspect, an embodiment of the present application provides a disk array management device, including:

[0011] A creation module, configured to create a corresponding domain path for a target disk group by using a first program running in a first kernel, and to send a first notification message to a volume management driver running in the first kernel when determining that the creation of the domain path is completed;

[0012] A first sending module, used for sending second notification information to the disk driver running in the second kernel by using the volume management driver in response to the first notification message, wherein the second notification information is used for notifying the disk driver to perform scanning;

[0013] The second sending module is used to utilize the disk driver to respond to the second notification information, and when the scanning of the target disk group is completed, send the third notification information to the device management program running in the third kernel, so that the device management program responds to the third notification information and completes the creation of the disk array corresponding to the target disk group.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, a first program running in a first kernel creates a corresponding domain path for a target disk group, and when it is determined that the domain path creation is completed, a first notification message is sent to a volume management driver running in the first kernel; the volume management driver responds to the first notification message and sends a second notification message to a disk driver running in a second kernel, the second notification message being used to notify the disk driver to perform a scan; the disk driver responds to the second notification message and, when the scan of the target disk group is completed, sends a third notification message to a device management program running in a third kernel, so that the device management program completes the creation of a disk array corresponding to the target disk group in response to the third notification message.

[0015] In a fourth aspect, an embodiment of the present application provides a storage medium storing executable instructions, which, when executed by a processor, enable a first program running in a first kernel to create a corresponding domain path for a target disk group, and when determining that the domain path creation is completed, send a first notification message to a volume management driver running in the first kernel; the volume management driver responds to the first notification message and sends a second notification message to a disk driver running in a second kernel, the second notification message being used to notify the disk driver to perform a scan; the disk driver responds to the second notification message and, when completing the scan of the target disk group, sends a third notification message to a device management program running in a third kernel, so that the device management program completes the creation of a disk array corresponding to the target disk group in response to the third notification message.

[0016] In a fifth aspect, a computer program product includes a first program, a volume management driver, a disk driver and a device management program, wherein the first program running in a first kernel creates a corresponding domain path for a target disk group, and when determining that the domain path creation is completed, sends a first notification message to the volume management driver running in the first kernel; the volume management driver responds to the first notification message and sends a second notification message to the disk driver running in a second kernel, the second notification message being used to notify the disk driver to perform a scan; the disk driver responds to the second notification message and, when completing the scan of the target disk group, sends a third notification message to the device management program running in a third kernel, so that the device management program completes the creation of a disk array corresponding to the target disk group in response to the third notification message. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of an implementation flow of a disk array management method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of an implementation flow of a method for creating a domain path provided in an embodiment of the present application;

[0019] Figure 3A A schematic diagram of an implementation process for obtaining domain name information provided in an embodiment of the present application;

[0020] Figure 3B A schematic diagram of an implementation flow of a method for creating a domain path provided in an embodiment of the present application;

[0021] Figure 4A A schematic diagram of the implementation process of the disk management method provided in the embodiment of the present application;

[0022] Figure 4B A schematic diagram of the implementation process of the method for creating a domain path provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram of the structure of a disk array management device provided in an embodiment of the present application;

[0024] Figure 6 A hardware entity schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the embodiments of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.

[0026] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0027] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0029] The present application embodiment provides a disk array management method, such as Figure 1 As shown, the method includes:

[0030] Step S110: the first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel when it is determined that the creation of the domain path is completed;

[0031] Here, the first core is also called the central processing unit core (Central Processing Unit Core), which is the core chip in the middle of the central processing unit (CPU), used to perform all calculations, receive / store commands, process data and other tasks, and is the core of digital processing. A central processing unit contains multiple processor cores (CPU cores), each of which can process tasks independently and can process multiple tasks in parallel, thereby improving computing efficiency. The first core (Core 0) is a processor core set in the central processing.

[0032] The target disk group may include multiple independent disks. For example, multiple solid-state drives (SSDs) may be combined into a disk group to increase read / write speed and data throughput.

[0033] The first program is set in the first kernel and can create a corresponding domain path for the target disk group of the electronic device. The first program can be a program for implementing domain path creation that is independent of the volume management device (VMD) driver running in the first kernel. For example, the first program can be a domain framework (DomainFramework) program. The domain framework can be a software framework designed for a specific application field, which provides a set of predefined functions, classes and interfaces for the specific needs of the field, so that developers can quickly develop applications that meet the requirements of the field on this basis. The domain framework usually has good scalability, allowing developers to customize and expand according to their needs, and the domain framework has high stability and can reduce the risk of application errors. Volume management driver.

[0034] The volume management driver (VMD driver) can be used to identify the hardware devices (disk groups) connected to the central processing unit, ensuring that the operating system can effectively control and manage the disk group, thereby achieving the normal operation of various hardware functions. Among them, VMD is a module integrated inside the central processing unit, which is used for hot-swap management and error handling of disks. It supports hot upgrades and replacements of non-volatile memory express (NVMe) solid-state drives from the high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe) bus. Through VMD, the status of the disk can be identified more quickly, which is helpful for system management and maintenance. Among them, non-volatile memory express is a communication protocol designed for high-speed solid-state drives based on device interface standards. It provides high-speed and low-latency access performance, suitable for application scenarios that require high-performance storage solutions, such as data centers, servers, high-performance computing (HPC), and client systems that require fast data access.

[0035] Here, the first program and the volume management driver are both running in the same kernel, namely the first kernel, and the program in the first kernel runs in the kernel space of the operating system. Among them, the device driver (including the volume management driver) in the kernel space is used to interact with the hardware device (including the disk manager).

[0036] The domain path is a condition for creating a disk array corresponding to the target disk, that is, the disk array can be created when the correct domain path is identified. Among them, Redundant Array of Independent Disks (RAID ARRAY), referred to as RAID, is a method of combining multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance and data backup technology than a single hard disk. For example, the domain path of the target disk group can be " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device", where "0000:c7:00.5" is the Peripheral Component Interconnect (PCI) domain corresponding to the target disk group, "0000" can represent the root domain or starting domain of the PCI bus; "c7" can identify the number of a target disk group on the PCI bus; "00.5" can represent a specific function or port on the target disk group. During the implementation process, when it is recognized that the domain path has been created, the corresponding disk array can be created successfully.

[0037] During implementation, the first program may send a first notification message to a volume management driver also running in the first kernel when the creation of the domain path corresponding to the target disk group is completed, so that the volume management driver determines that the creation of the domain path has been completed.

[0038] Step S120: the volume management driver sends a second notification message to the disk driver running in the second kernel in response to the first notification message, wherein the second notification message is used to notify the disk driver to perform scanning;

[0039] During implementation, upon receiving the first notification message, the volume management driver sends a second notification message to the disk driver running in the second kernel, informing the disk driver to scan non-volatile memory express disks (NVME devices).

[0040] Here, the volume management driver may scan the VMD controllers available in the system, that is, the scanning object is the VMD controller.

[0041] The disk driver can scan the NVMe disk connected to the VMD controller, that is, the scanning object is the NVMe disk.

[0042] During implementation, the disk driver performs scanning of NVMe disks, which is the disk initialization and identification process, to ensure that the system can correctly identify, configure, and use these high-speed storage disks.

[0043] The disk driver runs in another core of the CPU different from the first core, namely the second core (Core 1). The second notification message is a message sent by the volume management driver running in the first core to the disk driver running in the second core.

[0044] Here, the program in the second kernel runs in the kernel space of the operating system, wherein the device driver (including the disk driver) in the kernel space is used to interact with the hardware device (including the disk group).

[0045] Step S130, the disk driver responds to the second notification information, and upon completing scanning the target disk group, sends a third notification information to the device management program running in the third kernel, so that the device management program completes the creation of the disk array corresponding to the target disk group in response to the third notification information.

[0046] During the implementation process, when the disk driver receives the second notification information, it starts to scan the target disk group, that is, initializes and identifies the target disk group. After completing the scan, the disk driver sends a third notification information to the device manager (Userspace DEVice manager, udev) running in the third core (Core 2).

[0047] Here, the device management program running in the third kernel runs in the user space of the operating system. The user space refers to the memory area in the operating system where user programs and applications run, which is opposite to the kernel space of the operating system. The user space includes non-kernel code and data, such as applications, library functions, runtime environment, etc. The user space isolates the user program from the kernel, preventing the user program from directly accessing or destroying the kernel data, thereby enhancing the security of the system.

[0048] Device management programs are tools for managing hardware devices (disk groups) through automatic device identification and configuration, flexible device rules, dynamic device management, and simplified device naming and access. For example, in Linux systems, you can use the mdadm tool to manage disk arrays. In Windows systems, you can view and manage disk arrays through disk management tools. When a disk group is inserted into an electronic device, the device management program can automatically detect and identify the disk group and perform corresponding configurations according to predefined rules.

[0049] During implementation, the device management program checks whether the domain path of the target disk group is created in response to the third notification information, and completes the creation of the disk array corresponding to the target disk group when it is determined that the domain path is correct.

[0050] In some embodiments, when the disk array corresponding to the target disk group is created, the first program can continue to create a corresponding domain path for the next target disk group (disk group 2) to achieve the creation of the disk array corresponding to disk group 2 based on the transmission of the notification message. By executing sequentially, the creation of arrays corresponding to all disk groups set on the electronic device can be achieved.

[0051] In the embodiment of the present application, the first program creates a corresponding domain path for the target disk group, and can transmit notification information so that the device management program can successfully configure the disk array corresponding to the target disk when checking that the domain path has been created. In this way, each time the electronic device is powered on, the disk array can be correctly created without affecting the normal operation of the operating system.

[0052] In some embodiments, the above step S110 "the first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel when determining that the creation of the domain path is completed" is as follows: Figure 2 As shown, this can be achieved by following the steps below:

[0053] Step S210, the first program obtains domain name information corresponding to the target disk group;

[0054] Here, different disk groups correspond to different domain name information. For example, the domain name information corresponding to disk group 1 is "0000:c7:00.5", and the domain name information corresponding to disk group 2 is "0000:c8:00.5".

[0055] In the implementation process, the first program (Domain Framework) can be used to obtain domain information (Getdomain info). For example, the domain framework program set in the first core (Core 0) can be used to obtain the PCI domain information "0000:c7:00.5" corresponding to the disk 1.

[0056] Step S220: the first program creates the domain path based on the domain name information;

[0057] Here, the domain path can be used to describe the path of a PCI device (disk group) in the operating system, which can be a disk group related to the VMD driver. The disk group controller (VMD controller) is connected to the motherboard through PCIe or other interfaces. For example, different disk groups connected to the same processor can correspond to a part of the path of the same part in the domain path, and different parts of the path in the domain path can be set based on different disk groups corresponding to different domain name information.

[0058] During the implementation, since different disk groups correspond to different domain name information and different disk groups have different domain paths, the first program can create a domain path based on the domain name information. For example, the domain path corresponding to disk group 1 can be " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device". Then " / sys / bus / pci / drivers / vmd / " and " / domain / device" are paths for which different disk groups connected to the same processor can set the same part of the domain path, and "0000:c7:00.5" is a path for which different disk groups can set different parts of the domain path corresponding to different domain name information.

[0059] Step S230: When determining that the creation of the domain path is completed, the first program sends the first notification message to the volume management driver.

[0060] During the implementation process, when the first program determines that the VMD path generation is completed, it sends a first notification message (Notify) to the volume management driver in the first kernel.

[0061] In the embodiment of the present application, the first program first obtains the domain name information corresponding to the target disk group; then creates a domain path based on the domain name information; and finally, when it is determined that the creation of the domain path is completed, sends a first notification message to the volume management driver. In this way, it is possible to create a correct domain path based on the domain name information obtained first, and further complete the creation of the domain path before creating the disk array.

[0062] In some embodiments, the above step S210 "the first program obtains the domain name information corresponding to the target disk group" is as follows: Figure 3A As shown, this can be achieved by following the steps below:

[0063] Step S211, the volume management driver scans the bus interface to identify domain name information corresponding to a group of disks connected to the bus interface as domain name information corresponding to the target disk group;

[0064] Here, the volume management driver is used to identify, configure and manage the physical disks and logical volumes connected to the system to ensure the correct storage and access of data. When scanning the bus interface, the volume management driver can find a group of disks connected to the bus interface by scanning the bus interface, and collect the domain name information of the disk group as the domain name information corresponding to the target disk group.

[0065] During implementation, the volume management driver first identifies the type of bus connected to the system, such as SATA, SAS, PCIe, etc. The volume management driver can then enumerate all disk groups connected to the bus through the bus interface. Specific commands or queries can be sent to obtain a list of connected devices. For the enumerated disk groups, the volume management driver can also query the domain name information of the disk group, which involves communicating with the disk group to obtain its configuration or metadata. Here, the domain name information can be related to the file system or network configuration. Different disk groups correspond to different domain name information.

[0066] Step S212: The first program executes a domain name information callback function to obtain the domain name information, wherein the domain name information callback function is registered by the volume management driver for the first program.

[0067] Here, the domain information callback function, vmd_get_domain_info(), is registered by the volume management driver for the first program. Registering the domain information callback function once can be used multiple times to obtain domain information. For example, vmd_get_domain_info() can be used to obtain the PCI domain of the VMD hardware (target disk group): 0000:c7:00.5.

[0068] In the embodiment of the present application, first, the volume management driver scans the bus interface to identify the domain name information corresponding to a group of disks connected to the bus interface as the domain name information corresponding to the target disk group; then the domain name information callback function is executed to obtain the domain name information. In this way, the pre-registered domain name information callback function can be used to obtain the domain name information of the target disk group that has been identified and generated by the volume management driver.

[0069] In some embodiments, the above step S220 "the first program creates the domain path based on the domain name information" is as follows: Figure 3B As shown, this can be achieved by following the steps below:

[0070] Step S221, the first program obtains volume management path information;

[0071] Here, the volume management path information is the path information of the same part of the setting domain path corresponding to a part of different disk groups connected to the same processor. For example, the volume path may be " / sys / bus / pci / drivers / vmd / ", that is, the system volume path generated by the volume management driver.

[0072] During implementation, corresponding volume management path information may be generated when the volume management driver is loaded.

[0073] Step S222: The first program creates the domain path based on the domain name information and the volume management path information.

[0074] Here, since the domain name information corresponding to the target disk group has been obtained, the domain path corresponding to the target disk can be created based on the domain name information and volume management path information. For example, the volume path can be " / sys / bus / pci / drivers / vmd / ", the domain information can be "0000:c7:00.5", and the domain path corresponding to the target disk can be created as " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".

[0075] In the embodiment of the present application, the first program first obtains the volume management path information, and then creates a domain path based on the domain name information and the volume management path information. In this way, a correct and available domain path can be generated for the target disk group based on the volume management path information and the domain name information.

[0076] In some embodiments, the above step 221 "the first program obtains volume management path information" can be implemented by the following process:

[0077] generating the volume management path information when the volume management driver is loaded;

[0078] Here, when the operating system is started or the disk group is recognized, the volume management driver can be loaded into the memory and initialized. The initialization process includes checking the compatibility of the disk group, allocating necessary system resources, etc.

[0079] During the process of building a disk group, the volume management driver generates the corresponding volume management path information. This volume management path information can be used to uniquely identify and access the disk group in the operating system. The volume management path information may include the name, identifier, file path, etc. of the disk group.

[0080] Correspondingly, the above step 222 "the first program creates the domain path based on the domain name information and the volume management path information" can be implemented by the following process:

[0081] The first program concatenates the domain name information and the volume management path information to obtain the domain path.

[0082] For example, the domain name information of the target disk group is "0000:c7:00.5", the volume management path information is " / sys / bus / pci / drivers / vmd / ", and the firmware path information " / domain / device" is added after the domain name information. The domain path is shown as follows:

[0083] " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".

[0084] In the embodiment of the present application, first, when the volume management driver is loaded, the volume management path information is generated; then the first program splices the domain name information and the volume management path information to obtain the domain path. In this way, the volume management firmware information obtained when the volume management program is loaded can be spliced ​​with the domain name information, and then the fixed path information after the domain name information can be spliced ​​to generate a correct and available domain path for the target disk group.

[0085] In some embodiments, after the first program sends the first notification message to the volume management driver in step S110, the following steps are further included:

[0086] Step S140: The first program wakes up other programs waiting to be executed in the first kernel.

[0087] Here, the task scheduler in the operating system kernel can decide which program should run in the next processor time slice. When a program needs to wait for an event, such as building the domain path corresponding to the target disk group, the program will be placed in a waiting queue. The waiting queue is a data structure in the kernel used to manage waiting programs.

[0088] During implementation, the first kernel may provide a wake-up mechanism, allowing the first program to wake up other programs by sending a signal or modifying the state of a waiting queue.

[0089] When the first program triggers a wake-up event, the kernel checks the corresponding waiting queue and transfers other waiting programs to the ready queue so that they can be scheduled for execution by the task scheduler.

[0090] In the embodiment of the present application, after the first program sends the first notification message to the volume management driver, it wakes up other programs waiting to run in the first kernel. In this way, by using the wake-up mechanism, timely scheduling and other program running can be realized, thereby reducing the waiting running time of other programs.

[0091] Figure 4A A flowchart of a disk management method provided in an embodiment of the present application is shown in FIG. Figure 4A As shown, this can be achieved by following the steps below:

[0092] Step 1: When the VMD driver is loaded, the corresponding path is generated;

[0093] During implementation, when the VMD driver is loaded, the path “ / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / ” may be generated.

[0094] Step ②, the VMD driver registers a domain information callback function with the domain framework module;

[0095] Here, the domain framework module is the first program, which runs in the first core (Core 0). The domain information callback function is used to obtain the PCI domain information of the VMD hardware. The VMD driver registers a domain information callback function with the domain framework module. The registration action is executed once to complete the registration of the domain information callback function, and then the domain information callback function can be used multiple times to complete the acquisition of domain information. Among them, the VMD driver also runs in the first core.

[0096] Step ③, the domain framework module executes the corresponding domain information callback function to obtain the corresponding PCI domain;

[0097] Step ④, the domain framework module uses the domain information callback function to obtain the PCI domain of the VMD hardware;

[0098] For example, the domain information callback function is vmd_get_domain_info(), and the domain information callback function can obtain the PCI domain of the target VMD hardware: 0000:c7:00.5.

[0099] Step 5: After the domain framework module obtains the PCI domain of the corresponding VMD hardware, it creates the corresponding domain path;

[0100] For example, after the domain framework module obtains the PCI domain corresponding to the VMD hardware: 0000:c7:00.5, it can obtain the volume path " / sys / bus / pci / drivers / vmd / " in step ①, concatenate it with the PCI domain, and add the fixed path "domain / device", and create the domain path corresponding to the disk array as " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".

[0101] Step ⑥: The domain framework module obtains the module notifying the VMD driver that the corresponding domain path has been created;

[0102] During implementation, the domain framework module may send a first notification message to the volume management driver (VMD driver) when determining that the domain path creation has been completed.

[0103] Step 7: The VMD driver notifies the NVME driver to start scanning the NVMe hard disk connected to the VMD controller;

[0104] During implementation, the VMD driver sends a second notification message to the disk driver program (NVME driver) running in the second core (Core 1) in response to the first notification message, and the second notification message is used to notify the NVME driver to perform a disk scan.

[0105] The NVME driver responds to the second notification information and scans the NVMe hard disk connected to the VMD controller, which can be as follows: Figure 4A Disk group 1 is shown.

[0106] Step ⑧, the NVME driver notifies the device management program to create a disk array;

[0107] During the implementation process, the NVME driver responds to the second notification information, and upon completing the scanning of disk group 1, sends a third notification information to the device management program running in the third core (Core 1), so that the device management program responds to the third notification information and completes the creation of the disk array corresponding to disk group 1.

[0108] Step 9: Use the disk management tool to check the domain path;

[0109] For example, the disk management tool may be mdadm, which is a software independent redundant array of disks management tool under Linux, and its full name is multiple devices admin. Among them, mdadm can perform almost all RAID management functions, including but not limited to:

[0110] Create a RAID array: You can specify parameters such as the RAID level (such as RAID0, RAID1, RAID5, etc.), the number of active devices, and the number of spare devices.

[0111] Manage RAID arrays: including adding, removing, and replacing RAID device members, and marking devices as failed.

[0112] Monitor RAID array: You can start or stop monitoring mode to view the status and detailed information of the RAID array in real time.

[0113] Save RAID configuration: You can save the RAID configuration information to a configuration file so that the RAID array can be automatically reassembled after a reboot.

[0114] During the implementation process, you can use mdadm to check whether the domain path has been created successfully.

[0115] Step ①0: After confirming that the domain path is correct, the disk management tool creates a disk array.

[0116] In some embodiments, when the disk array corresponding to disk group 1 is created, the domain framework module can continue to create a corresponding domain path for the next target disk group (disk group 2) to realize the creation of the disk array corresponding to disk group 2 based on the transmission of the notification message. By executing sequentially, the creation of arrays corresponding to all disk groups set on the electronic device can be realized.

[0117] In the embodiment of the present application, a domain framework module is added to complete the creation of the domain path of the disk group before the disk array needs to be created, thereby achieving effective and error-free disk array creation.

[0118] Figure 4B A flow chart of a method for creating a domain path provided in an embodiment of the present application is as follows: Figure 4B As shown, this can be achieved by following the steps below:

[0119] Step 1: When the VMD driver is loaded, the corresponding path is generated;

[0120] In the implementation process, the probe function can be used to obtain the volume path " / sys / bus / pci / drivers / vmd / ". The probe function is an entry point in the NVMe driver. When the operating system recognizes a storage device that supports the NVMe protocol through the PCIe bus, the probe function of the NVMe driver of the device can be called to obtain the volume path.

[0121] Step ②, the VMD driver registers a domain information callback function with the domain framework module;

[0122] Here, the domain information callback function is used to obtain the PCI domain information of the VMD hardware. The registration action can be performed once to complete the registration of the domain information callback function, and then the domain information callback function can be used multiple times to complete the acquisition of domain information.

[0123] Step ③, the domain framework module executes the corresponding domain information callback function to obtain the corresponding PCI domain;

[0124] Step ④, the domain information callback function obtains the PCI domain of the VMD hardware;

[0125] For example, the domain information callback function is vmd_get_domain_info(), and the domain information callback function can obtain the PCI domain of the target VMD hardware: 0000:c7:00.5.

[0126] Step 5: After the domain framework module obtains the PCI domain of the corresponding VMD hardware, it creates the corresponding domain path;

[0127] For example, after the domain framework module obtains the PCI domain corresponding to the VMD hardware: 0000:c7:00.5, it can obtain the volume path " / sys / bus / pci / drivers / vmd / " in step ①, concatenate it with the PCI domain, and add the fixed path "domain / device", and create the domain path corresponding to the disk array as " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".

[0128] Step ⑥: The domain framework module receives the module notifying the VMD driver that the corresponding domain path has been created.

[0129] In some embodiments, after completing step ⑥, other waiting programs may be awakened to continue execution.

[0130] In the embodiment of the present application, a domain framework module is added, and the volume management driver is notified after the domain path of the disk group is created, so that the creation of the domain path corresponding to the disk group is completed before the disk array is created.

[0131] Based on the foregoing embodiments, an embodiment of the present application provides a disk array management device, which includes the modules included, each module includes each sub-module, each sub-module includes a unit, which can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0132] Figure 5 A schematic diagram of the structure of a disk array management device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the device 500 includes:

[0133] A creation module 510 is used to create a corresponding domain path for the target disk group by using a first program running in a first kernel, and send a first notification message to a volume management driver running in the first kernel when it is determined that the creation of the domain path is completed;

[0134] A first sending module 520, configured to send second notification information to a disk driver running in a second kernel by using the volume management driver in response to the first notification message, wherein the second notification information is used to notify the disk driver to perform scanning;

[0135] The second sending module 530 is used to utilize the disk driver to respond to the second notification information, and upon completing the scanning of the target disk group, send a third notification information to the device management program running in the third kernel, so that the device management program responds to the third notification information and completes the creation of the disk array corresponding to the target disk group.

[0136] In some embodiments, the creation module 510 includes an acquisition submodule, a creation submodule and a sending submodule, wherein the acquisition submodule is used to use the first program to acquire the domain name information corresponding to the target disk group; the creation submodule is used to use the first program to create the domain path based on the domain name information; the sending submodule is used to use the first program to send the first notification message to the volume management driver when determining that the creation of the domain path is completed.

[0137] In some embodiments, the acquisition submodule includes a scanning unit and a first acquisition unit, wherein the scanning unit is used to use the volume management driver to scan the bus interface to identify domain name information corresponding to a group of disks connected to the bus interface as the domain name information corresponding to the target disk group; the first acquisition unit is used to use the first program to execute a domain name information callback function to obtain the domain name information, wherein the domain name information callback function is registered by the volume management driver for the first program.

[0138] In some embodiments, the creation submodule includes a second acquisition unit and a creation unit, wherein the second acquisition unit is used to use the first program to acquire volume management path information; and the creation unit is used to use the first program to create the domain path based on the domain name information and the volume management path information.

[0139] In some embodiments, the second acquisition unit is further used to generate the volume management path information when the volume management driver is loaded; the creation unit is further used to use the first program to splice the domain name information and the volume management path information to obtain the domain path.

[0140] In some embodiments, the disk management device further includes a wake-up module for using the first program to wake up other programs waiting to run in the first kernel.

[0141] In some embodiments, the first program, the volume management driver and the disk driver run in the kernel space of an operating system, and the device management program runs in the user space of the operating system.

[0142] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0143] It should be noted that in the embodiment of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable an electronic device (which can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0144] Correspondingly, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the disk array management method provided in the above embodiment are implemented.

[0145] Correspondingly, an embodiment of the present application provides an electronic device, Figure 6 A hardware entity diagram of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the hardware entity of the device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores a computer program that can be run on the processor 602, and when the processor 602 executes the program, the steps in the disk array management method provided in the above embodiment are implemented.

[0146] The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data to be processed or processed by the processor 602 and various modules in the electronic device 600 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0147] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0148] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0149] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or 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 device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0150] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0152] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0153] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0154] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0155] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0156] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0157] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0158] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for managing a disk array, the method comprising: The first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel when it is determined that the creation of the domain path is completed; The volume management driver sends a second notification message to the disk driver running in the second kernel in response to the first notification message, wherein the second notification message is used to notify the disk driver to perform scanning; The disk driver responds to the second notification information and, upon completing scanning the target disk group, sends a third notification information to the device management program running in the third kernel, so that the device management program completes creation of the disk array corresponding to the target disk group in response to the third notification information.

2. The method according to claim 1, wherein the first program running in the first kernel creates a corresponding domain path for the target disk group, and when it is determined that the creation of the domain path is completed, sends a first notification message to a volume management driver running in the first kernel, comprising: The first program obtains domain name information corresponding to the target disk group; The first program creates the domain path based on the domain name information; When determining that the creation of the domain path is completed, the first program sends the first notification message to the volume management driver.

3. The method according to claim 2, wherein the first program obtains the domain name information corresponding to the target disk group, comprising: The volume management driver scans the bus interface to identify domain name information corresponding to a group of disks connected to the bus interface as domain name information corresponding to the target disk group; The first program executes a domain name information callback function to obtain the domain name information, wherein the domain name information callback function is registered by the volume management driver for the first program.

4. The method according to claim 2, wherein the first program creates the domain path based on the domain name information, comprising: The first program obtains volume management path information; The first program creates the domain path based on the domain name information and the volume management path information.

5. The method according to claim 4, wherein the first program obtains volume management path information, comprising: generating the volume management path information when the volume management driver is loaded; Correspondingly, the first program creates the domain path based on the domain name information and the volume management path information, including: The first program concatenates the domain name information and the volume management path information to obtain the domain path.

6. The method according to any one of claims 1 to 5, after the first program sends a first notification message to the volume management driver, the method further comprises: The first program wakes up other programs waiting to be executed in the first kernel.

7. The method according to any one of claims 1 to 5, wherein the first program, the volume management driver and the disk driver run in the kernel space of an operating system, and the device management program runs in the user space of the operating system.

8. A disk array management device, the device comprising: A creation module, configured to create a corresponding domain path for a target disk group by using a first program running in a first kernel, and, when determining that the creation of the domain path is completed, send a first notification message to a volume management driver running in the first kernel; a first sending module, configured to send second notification information to a disk driver running in a second kernel by using the volume management driver in response to the first notification message, wherein the second notification information is used to notify the disk driver to perform scanning; The second sending module is used to utilize the disk driver to respond to the second notification information, and when the scanning of the target disk group is completed, send the third notification information to the device management program running in the third kernel, so that the device management program responds to the third notification information and completes the creation of the disk array corresponding to the target disk group.

9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, a first program running in a first kernel creates a corresponding domain path for a target disk group, and when it is determined that the creation of the domain path is completed, a first notification message is sent to a volume management driver running in the first kernel; The volume management driver sends a second notification message to the disk driver running in the second kernel in response to the first notification message, wherein the second notification message is used to notify the disk driver to perform scanning; The disk driver responds to the second notification information and, upon completing scanning the target disk group, sends a third notification information to the device management program running in the third kernel, so that the device management program completes creation of the disk array corresponding to the target disk group in response to the third notification information.

10. A computer program product comprising a first program, a volume management driver, a disk driver and a device management program, wherein: The first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel when determining that the creation of the domain path is completed; In response to the first notification message, the volume management driver sends a second notification message to the disk driver running in the second kernel, wherein the second notification message is used to notify the disk driver to perform scanning; The disk driver responds to the second notification information and, upon completing scanning the target disk group, sends a third notification information to the device management program running in the third kernel, so that the device management program completes creation of the disk array corresponding to the target disk group in response to the third notification information.

Citation Information

Patent Citations

  • Magnetic disk device driving method, system, device and readable storage medium

    CN109032523A

  • Disk function configuration method and device, equipment and storage medium

    CN115469807A

  • Disk management method and device based on libvirt, equipment and storage medium

    CN117193631A

  • Computer system and virtual server migration control method for computer system

    US20130282887A1

  • Device driver to provide redundant array of independent disks functionality

    US20180095679A1