A metadata management memory application method, device, equipment and medium

CN115408308BActive Publication Date: 2026-08-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211049483.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2026-08-21
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

[0003]目前,控制器在计算出元数据管理所需要的动态申请的内存页数后,将内存页数保存在控制器端指定的结构体成员中,通过消息机制发送给CSM端,CSM端收到消息后,将内存页数保存在CSM端指定的结构体成员中,但如果控制器在计算出内存页数后,与结构体成员保存的值相同,则表明控制器端的结构体成员与CSM端的结构体成员的值相同,不会触发消息机制,CSM端保存的值便不会被更新,相应的回调函数不会被触发,后续流程就不会执行,导致全闪精简池无法被正常创建

Benefits of technology

[0037] As can be seen, after determining the number of memory pages required for metadata management based on its own memory size, this application updates the highest bit of the first structure member, saves the number of memory pages to the updated first structure member, and retains the value of the highest bit of the updated first structure member during the saving process. Then, it triggers a message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application updates the highest bit of the first structure member used to store the memory page number. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the memory page number is calculated, the first structure member used to store the memory page number changes, thereby triggering the message sending mechanism normally. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408308B_ABST
    Figure CN115408308B_ABST
Patent Text Reader

Abstract

The application discloses a metadata management memory application method and device, equipment and medium, comprising: determining the number of metadata management required memory pages based on the size of the memory itself; updating the highest bit of the first structure member, saving the number of memory pages to the updated first structure member, and preserving the value of the highest bit of the updated first structure member during the saving process; triggering a message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-control cluster, so that the CSM end assigns the first structure member to the second structure member and applies for memory based on the second structure member. In this way, the number of memory pages related messages of the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of memory allocation technology, and in particular to a method, apparatus, device and medium for metadata management memory allocation. Background Technology

[0002] A multi-controller cluster refers to a cluster consisting of two or more dual-controller storage devices. The entire cluster shares a common CSM (Control state machine, which is represented by the control state machine of each module in the storage system) to control the cluster's management information. Each storage device has two controllers and can be considered an IOGROUP (Input / Output group). The number of IOGROUPs in a multi-controller cluster is equal to the number of storage devices it consists of. The memory sizes of the storage devices that make up the cluster can be different. Multiple all-flash thin pools can be created within an IOGROUP. When using an all-flash thin pool in a multi-controller cluster, the memory pages for the metadata management portion used by the all-flash thin pool must be dynamically allocated and reclaimed. That is, when creating the first all-flash thin pool in an IOGROUP, the memory pages required for the thin pool metadata management of that IOGROUP must be requested from the DMM (Dynamic Memory Management) module. When deleting the last all-flash thin pool in an IOGROUP, the memory pages requested for the thin pool metadata management of that IOGROUP must be released and returned to the DMM module.

[0003] Currently, after calculating the number of dynamically allocated memory pages required for metadata management, the controller stores the memory page number in a structure member specified on the controller side and sends it to the CSM side via a message mechanism. After receiving the message, the CSM side stores the memory page number in a structure member specified on the CSM side. However, if the value stored in the structure member is the same after the controller calculates the memory page number, it indicates that the values ​​of the structure member on the controller side and the structure member on the CSM side are the same. The message mechanism will not be triggered, the value stored on the CSM side will not be updated, the corresponding callback function will not be triggered, and the subsequent process will not be executed, resulting in the failure of the all-flash thin pool to be created normally. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method, apparatus, device, and medium for metadata management memory allocation, which can ensure that memory page number-related messages from the controller can be transmitted to the CSM, thereby ensuring the normal creation of the all-flash thin pool. The specific solution is as follows:

[0005] In a first aspect, this application discloses a metadata management memory allocation method, applicable to any controller in a dual-controller storage device in a multi-controller cluster, comprising:

[0006] Determine the number of memory pages required for metadata management based on the size of the memory itself;

[0007] Update the highest bit of the first structure member, save the memory page number to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the saving process;

[0008] The message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0009] Optionally, updating the highest bit of the first structure member includes:

[0010] The first structure member is XORed with a preset trigger to update the highest bit of the first structure member; wherein the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

[0011] Optional, also includes:

[0012] Clear the non-highest bit of the first structure member after the XOR operation to obtain the updated first structure member.

[0013] Optionally, the step of saving the memory page number to the updated first structure member and retaining the value of the highest bit of the updated first structure member during the saving process includes:

[0014] Assign the memory page number to a preset temporary variable;

[0015] Perform a bitwise AND operation between the preset temporary variable and the preset mask to obtain the variable after the AND operation; wherein, the preset mask is a mask in which the highest bit is 0 and all other bits are 1;

[0016] Perform an OR operation between the ANDed variable and the updated first structure member.

[0017] Optionally, after assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member.

[0018] Optionally, the process of clearing the highest bit of the second structure member is as follows:

[0019] Perform a bitwise AND operation between the second structure member and the preset mask.

[0020] Optionally, before determining the number of memory pages required for metadata management based on its own memory size, the method further includes:

[0021] Obtain the memory page number query message sent by the CSM terminal;

[0022] Based on the requested memory page query message, determine whether it belongs to the input / output group of the all-flash thin pool to be created. If so, start the step of determining the number of memory pages required for metadata management based on its own memory size.

[0023] Secondly, this application discloses a metadata management memory allocation device, applied to any controller in a dual-controller storage device in a multi-controller cluster, comprising:

[0024] The memory page number determination module is used to determine the number of memory pages required for metadata management based on its own memory size.

[0025] The memory page count saving module is used to update the highest bit of the first structure member, save the memory page count to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the saving process;

[0026] The message sending module is used to trigger the message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0027] Optional, a memory page count storage module, specifically including:

[0028] The highest bit update submodule is used to perform an XOR operation between the first structure member and a preset trigger to update the highest bit of the first structure member; wherein, the preset trigger is a variable whose highest bit is 1 and all other bits are 0;

[0029] The XOR operation submodule is used to clear the non-most significant bit of the first structure member after the XOR operation, so as to obtain the updated first structure member.

[0030] The memory page number temporary storage submodule is used to assign the memory page number to a preset temporary variable;

[0031] The AND operation submodule is used to perform an AND operation between the preset temporary variable and the preset mask to obtain the AND-operated variable; wherein, the preset mask is a mask in which the highest bit is 0 and all other bits are 1;

[0032] The OR operation submodule is used to perform an OR operation between the AND-operated variable and the updated first structure member.

[0033] Thirdly, this application discloses an electronic device, including a memory and a processor, wherein:

[0034] The memory is used to store computer programs;

[0035] The processor is used to execute the computer program to implement the aforementioned metadata management memory allocation method.

[0036] Fourthly, this application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned metadata management memory allocation method.

[0037] As can be seen, after determining the number of memory pages required for metadata management based on its own memory size, this application updates the highest bit of the first structure member, saves the number of memory pages to the updated first structure member, and retains the value of the highest bit of the updated first structure member during the saving process. Then, it triggers a message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application updates the highest bit of the first structure member used to store the memory page number. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the memory page number is calculated, the first structure member used to store the memory page number changes, thereby triggering the message sending mechanism normally. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0039] Figure 1 This application discloses a flowchart of a metadata management memory allocation method.

[0040] Figure 2 This is a schematic diagram of the structure of a metadata management memory allocation device disclosed in this application;

[0041] Figure 3 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0043] Currently, after calculating the number of dynamically allocated memory pages required for metadata management, the controller stores the memory page number in a specified structure member on the controller side and sends it to the CSM end via a message mechanism. Upon receiving the message, the CSM end stores the memory page number in its own specified structure member. However, if the value stored in the structure member is the same after the controller calculates the memory page number, it indicates that the values ​​of the structure member on the controller side and the CSM end are identical. This prevents the message mechanism from being triggered, the value stored on the CSM end from being updated, the corresponding callback function from being triggered, and subsequent processes from executing, resulting in the failure to create the all-flash thin pool normally. Therefore, this application provides a metadata management memory allocation scheme that ensures that memory page number-related messages from the controller side can be transmitted to the CSM end, thereby guaranteeing the normal creation of the all-flash thin pool.

[0044] See Figure 1 As shown in the figure, this application discloses a metadata management memory allocation method, which is applied to any controller in a dual-controller storage device in a multi-controller cluster, including:

[0045] Step S11: Determine the number of memory pages required for metadata management based on the user's own memory size.

[0046] In one implementation, this application embodiment can obtain the request memory page number query message sent by the CSM terminal; based on the request memory page number query message, determine whether it belongs to the input / output group of the all-flash thin pool to be created; if so, initiate the step of determining the number of memory pages required for metadata management based on its own memory size.

[0047] Step S12: Update the highest bit of the first structure member, save the memory page number to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the saving process.

[0048] In a specific implementation, the embodiments of this application can perform an XOR operation between the first structure member and a preset trigger to update the highest bit of the first structure member; wherein, the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

[0049] Furthermore, the non-highest bit of the first structure member after the XOR operation is cleared to obtain the updated first structure member.

[0050] For example, define a uint32 SIZE_UTAS_TRIGGER_BIT 0x80000000, which represents a flip-flop where only the highest bit is 1 and the rest are 0; define a uint32 SIZE_VALUE_MASK 0x7FFFFFFFF, which represents a mask where only the highest bit is 0 and the rest are 1. The first structure member is agt->page_size. An XOR operation can be performed between agt->page_size and SIZE_UTAS_TRIGGER_BIT, inverting the highest bit of page_size. This ensures that each time agt->page_size is reassigned, the highest bit changes, making the entire value different from the previously stored value. Furthermore, an operation can be performed on the XORed agt->page_size: agt->page_size &= ~SIZE_VALUE_MASK, clearing all bits except the highest bit to prevent residual information.

[0051] Furthermore, the step of saving the memory page number to the updated first structure member and retaining the value of the highest bit of the updated first structure member during the saving process includes: assigning the memory page number to a preset temporary variable; performing a bitwise AND operation between the preset temporary variable and a preset mask to obtain a variable after the AND operation; wherein the preset mask is a mask in which the highest bit is 0 and all other bits are 1; and performing an OR operation between the variable after the AND operation and the updated first structure member.

[0052] For example, the number of memory pages is stored in a temporary variable `uint32 pages`. After clearing all bits except the highest bit, `agt->page_size` is calculated as: `agt->page_size |= pages&SIZE_VALUE_MASK`. The value stored in `pages`, excluding the highest bit, is assigned to `agt->page_size`, thus achieving the purpose of saving the number of dynamically allocated memory pages required for metadata management to `agt->page_size`.

[0053] Step S13: Trigger the message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0054] In a specific implementation, after the CSM terminal assigns the first structure member to the second structure member, it clears the highest bit of the second structure member and allocates memory based on the cleared second structure member. The specific process of clearing the highest bit of the second structure member involves performing a bitwise AND operation between the second structure member and the preset mask. Furthermore, in one implementation, a preset callback function is triggered to perform the bitwise AND operation between the second structure member and the preset mask. For example, if the second structure member is `csm->page_size`, after the callback function is triggered, the following operation will be performed to ensure the correct `page_size` value is obtained: `csm->page_size &=SIZE_VALUE_MASK`, to obtain information other than the highest bit.

[0055] In one implementation, the metadata management memory allocation scheme provided in this application is applied to the agent in the controller (represented as a module terminal on each node in the storage system, which is a software service), and each controller has one agent. The all-flash thin pool is a storage pool composed entirely of solid-state storage media capable of creating thin volumes. The following example, using the creation process of the all-flash thin pool, illustrates the metadata management memory allocation scheme provided in this application:

[0056] Assume a multi-controller cluster consists of storage device A with 128GB of memory and storage device B with 256GB of memory. Storage device A has an IOGROUP ID of IOGROUP0 and corresponding agents agt_A1 and agt_A2, while storage device B has an IOGROUP ID of IOGROUP1 and corresponding agents agt_B1 and agt_B2. Now, we need to create a thin all-flash pool in IOGROUP0:

[0057] Step 1: The CSM client receives the command to configure the behavior. Because the memory size of the storage devices is different, the number of dynamic memory pages required to allocate to the metadata management module when creating a thin pool will also be different. The CSM client needs to send a message to all online agents to query the number of memory pages that need to be dynamically requested;

[0058] Step 2: After all agents receive the message, the agents need to identify whether the IOGROUP that created the all-flash thin pool is their own IOGROUP. Under the aforementioned assumptions, agt_A1 and agt_A2 will calculate the amount of dynamically allocated memory (i.e., the number of memory pages) required by the metadata management module based on their own memory size, and send it to the CSM end through the message mechanism, while agt_B1 and agt_B2 do not need to send messages to the CSM end.

[0059] Step 3: After receiving messages agt_A1 and agt_A2, the CSM end will save the information on the dynamic memory size required by the metadata management module in the structure corresponding to IOGROUP 0, request memory from the DMM module for use by the metadata management module, trigger the callback function, and execute the subsequent memory allocation process to complete the creation of the all-flash thin pool.

[0060] After agt_A1 and agt_A2 obtain the number of dynamically allocated memory pages (pages1) required by the metadata management module of this node, they need to save the value of page1 in a uint32 agt->page_size and send it to the CSM end. However, due to a mechanism issue, if the value of agt->page_size is the same as the value already saved in csm->page_size on the CSM end, the message sending mechanism will not be triggered, the value saved on the CSM end will not be updated, the callback function on the CSM end will not be triggered, and subsequent processes will not be executed, resulting in the failure of the all-flash thin pool to be created normally. For example, forgetting to clear the values ​​in the structure members will cause the value of agt->page_size to be the same as the value already saved in csm->page_size on the CSM end.

[0061] The embodiments of this application can perform the following steps to overcome the above problems:

[0062] a) Define a uint32 SIZE_UTAS_TRIGGER_BIT 0x80000000, which represents a flip-flop where only the highest bit is 1 and the rest are 0;

[0063] b) Define a uint32 SIZE_VALUE_MASK 0x7FFFFFFFF. This value represents a mask where only the highest bit is 0 and the rest are 1.

[0064] c) agt_A1 and agt_A2 obtain the number of pages (page1) that the metadata management module of this node needs to dynamically request, and store them in the temporary variable uint32 pages;

[0065] d) Perform an XOR operation on agt->page_size and SIZE_UTAS_TRIGGER_BIT to invert the most significant bit of page_size. This way, each time agt->page_size is reassigned, the most significant bit will change, making the value of agt->page_size different from the previously saved value.

[0066] e) Use the agt->page_size obtained from step d) to perform the following calculation:

[0067] The purpose of `ag->page_size&=~SIZE_VALUE_MASK;` is to clear all bits except the most significant bit to prevent any residual information.

[0068] f) Using the agt->page_size calculated in step e), perform the following calculation:

[0069] agt->page_size|=pages&SIZE_VALUE_MASK; The purpose is to assign the value stored in pages, excluding the highest bit, to agt->page_size, so as to pass the number of pages (page1) that the metadata management module needs to dynamically request to agt->page_size;

[0070] g) After the callback function on the CSM side is triggered, the following operation will be performed to ensure that the correct page_size value is obtained: csm->page_size&=SIZE_VALUE_MASK; the purpose is to obtain information other than the highest bit.

[0071] Understandably, by combining the above steps with ag, the value of agt->page_size can be different each time. In this way, the number of pages (page1) that the metadata management module needs to dynamically request, obtained from agt_A1 and agt_A2, can be passed to the CSM side normally each time. This allows the callback function on the CSM side to be triggered normally, and the CSM side can obtain the correct page_size information to execute the subsequent process of creating the all-flash thin pool. This avoids the problem of all-flash thin pool creation failure caused by unsuccessful command line execution.

[0072] It's important to note that memory pages don't need to occupy 32 bits. In a multi-controller cluster, by using the highest bit of a uint32 variable as a trigger, it's ensured that agent-side information is transmitted to the CSM and that callback functions are invoked. This prevents commands from failing to execute correctly due to communication issues between the CSM and the agent, allowing the all-flash thin pool to be created and used normally.

[0073] As can be seen, in this embodiment, after determining the number of memory pages required for metadata management based on its own memory size, the highest bit of the first structure member is updated, the number of memory pages is saved to the updated first structure member, and the value of the highest bit of the updated first structure member is retained during the saving process. Then, a message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application embodiment updates the highest bit of the first structure member used to store the number of memory pages. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the number of memory pages is calculated, the first structure member used to store the memory page number changes, thereby normally triggering the message sending mechanism. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that the memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.

[0074] See Figure 2 As shown in the figure, this application discloses a metadata management memory allocation device, which is applied to any controller in a dual-controller storage device in a multi-controller cluster, including:

[0075] The memory page number determination module 11 is used to determine the number of memory pages required for metadata management based on its own memory size;

[0076] The memory page number storage module 12 is used to update the highest bit of the first structure member, save the memory page number to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the storage process 13;

[0077] The message sending module is used to trigger the message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0078] As can be seen, in this embodiment, after determining the number of memory pages required for metadata management based on its own memory size, the highest bit of the first structure member is updated, the number of memory pages is saved to the updated first structure member, and the value of the highest bit of the updated first structure member is retained during the saving process. Then, a message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application embodiment updates the highest bit of the first structure member used to store the number of memory pages. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the number of memory pages is calculated, the first structure member used to store the memory page number changes, thereby normally triggering the message sending mechanism. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that the memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.

[0079] The memory page count storage module 12 specifically includes:

[0080] The highest bit update submodule is used to perform an XOR operation between the first structure member and a preset trigger to update the highest bit of the first structure member; wherein, the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

[0081] The XOR operation submodule is used to clear the non-highest bit of the first structure member after the XOR operation, so as to obtain the updated first structure member.

[0082] The memory page number temporary storage submodule is used to assign the memory page number to a preset temporary variable;

[0083] The AND operation submodule is used to perform an AND operation between the preset temporary variable and the preset mask to obtain the AND-operated variable; wherein, the preset mask is a mask in which the highest bit is 0 and all other bits are 1;

[0084] The OR operation submodule is used to perform an OR operation between the AND-operated variable and the updated first structure member.

[0085] Specifically, after assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member.

[0086] Furthermore, the process of clearing the highest bit of the second structure member is as follows:

[0087] Perform a bitwise AND operation between the second structure member and the preset mask.

[0088] Furthermore, the device also includes:

[0089] Message Acquisition Module: Used to acquire the memory page request query message sent by the CSM terminal before determining the number of memory pages required for metadata management based on its own memory size;

[0090] The judgment module is used to determine whether it belongs to the input / output group of the all-flash thin pool to be created based on the requested memory page number query message. If so, the memory page number determination module 11 is started to perform the step of determining the number of memory pages required for metadata management based on its own memory size.

[0091] See Figure 3 As shown in the illustration, this application discloses an electronic device 20, including a processor 21 and a memory 22; wherein, the memory 22 is used to store a computer program; and the processor 21 is used to execute the computer program to implement the following steps:

[0092] The system determines the number of memory pages required for metadata management based on its own memory size; updates the highest bit of the first structure member, saves the number of memory pages to the updated first structure member, and retains the value of the highest bit of the updated first structure member during the saving process; triggers a message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0093] As can be seen, in this embodiment, after determining the number of memory pages required for metadata management based on its own memory size, the highest bit of the first structure member is updated, the number of memory pages is saved to the updated first structure member, and the value of the highest bit of the updated first structure member is retained during the saving process. Then, a message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application embodiment updates the highest bit of the first structure member used to store the number of memory pages. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the number of memory pages is calculated, the first structure member used to store the memory page number changes, thereby normally triggering the message sending mechanism. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that the memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.

[0094] In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, it can specifically implement the following steps: performing an XOR operation on the first structure member and a preset trigger to update the highest bit of the first structure member; wherein, the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

[0095] In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, it can specifically implement the following steps: clear the non-highest bit of the first structure member after the XOR operation to obtain the updated first structure member.

[0096] In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, it can specifically implement the following steps: assigning the memory page number to a preset temporary variable; performing a bitwise AND operation between the preset temporary variable and a preset mask to obtain a variable after the AND operation; wherein, the preset mask is a mask where the highest bit is 0 and all other bits are 1; performing an OR operation between the variable after the AND operation and the updated first structure member.

[0097] Specifically, after assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member. Furthermore, the process of clearing the highest bit of the second structure member involves performing a bitwise AND operation between the second structure member and the preset mask.

[0098] In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, it can specifically implement the following steps: before determining the number of memory pages required for metadata management based on its own memory size, it obtains the request memory page query message sent by the CSM terminal; based on the request memory page query message, it determines whether it belongs to the input / output group of the all-flash thin pool to be created; if so, it starts the step of determining the number of memory pages required for metadata management based on its own memory size.

[0099] Furthermore, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.

[0100] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26; wherein, the power supply 23 is used to provide operating voltage for the various hardware devices on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0101] Furthermore, embodiments of this application disclose a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:

[0102] The system determines the number of memory pages required for metadata management based on its own memory size; updates the highest bit of the first structure member, saves the number of memory pages to the updated first structure member, and retains the value of the highest bit of the updated first structure member during the saving process; triggers a message sending mechanism to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end can assign the first structure member to the second structure member and request memory based on the second structure member.

[0103] As can be seen, in this embodiment, after determining the number of memory pages required for metadata management based on its own memory size, the highest bit of the first structure member is updated, the number of memory pages is saved to the updated first structure member, and the value of the highest bit of the updated first structure member is retained during the saving process. Then, a message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM end of the multi-controller cluster, so that the CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. In other words, after calculating the number of memory pages required for metadata management, this application embodiment updates the highest bit of the first structure member used to store the number of memory pages. During the process of saving the memory page number to the updated first structure member, the value of this highest bit is retained. Thus, each time the number of memory pages is calculated, the first structure member used to store the memory page number changes, thereby normally triggering the message sending mechanism. The message carrying the updated first structure member is sent to the CSM end of the multi-controller cluster. The CSM end assigns the first structure member to the second structure member and requests memory based on the second structure member. This ensures that the memory page number-related messages from the controller end can be transmitted to the CSM end, thereby ensuring the normal creation of the all-flash thin pool.

[0104] In this embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, it can specifically implement the following steps: performing an XOR operation between the first structure member and a preset trigger to update the highest bit of the first structure member; wherein, the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

[0105] In this embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: clearing the non-highest bit of the first structure member after the XOR operation to obtain the updated first structure member.

[0106] In this embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: assigning the memory page number to a preset temporary variable; performing a bitwise AND operation between the preset temporary variable and a preset mask to obtain a variable after the AND operation; wherein, the preset mask is a mask in which the highest bit is 0 and all other bits are 1; performing an OR operation between the variable after the AND operation and the updated first structure member.

[0107] Specifically, after assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member. Furthermore, the process of clearing the highest bit of the second structure member involves performing a bitwise AND operation between the second structure member and the preset mask.

[0108] In this embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, it can specifically implement the following steps: before determining the number of memory pages required for metadata management based on its own memory size, it obtains the memory page request query message sent by the CSM terminal; based on the memory page request query message, it determines whether it belongs to the input / output group of the all-flash thin pool to be created; if so, it initiates the step of determining the number of memory pages required for metadata management based on its own memory size.

[0109] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0110] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0111] The foregoing has provided a detailed description of a metadata management memory allocation method, apparatus, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for allocating memory for metadata management, characterized in that, Any controller used in a dual-controller storage device within a multi-controller cluster, including: Determine the number of memory pages required for metadata management based on the size of the memory itself; Update the highest bit of the first structure member, save the memory page number to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the saving process; The message sending mechanism is triggered to send a message carrying the updated first structure member to the CSM terminal of the multi-controller cluster, so that the CSM terminal can assign the first structure member to the second structure member and request memory based on the second structure member; After assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member.

2. The metadata management memory allocation method according to claim 1, characterized in that, The update of the highest bit of the first structure member includes: The first structure member is XORed with a preset trigger to update the highest bit of the first structure member; wherein the preset trigger is a variable whose highest bit is 1 and all other bits are 0.

3. The metadata management memory allocation method according to claim 2, characterized in that, Also includes: Clear the non-highest bit of the first structure member after the XOR operation to obtain the updated first structure member.

4. The metadata management memory allocation method according to claim 3, characterized in that, The step of saving the memory page number to the updated first structure member and retaining the value of the highest bit of the updated first structure member during the saving process includes: Assign the memory page number to a preset temporary variable; Perform a bitwise AND operation between the preset temporary variable and the preset mask to obtain the variable after the AND operation; wherein, the preset mask is a mask in which the highest bit is 0 and all other bits are 1; Perform an OR operation between the ANDed variable and the updated first structure member.

5. The metadata management memory allocation method according to claim 4, characterized in that, The process of clearing the highest bit of the second structure member is as follows: Perform a bitwise AND operation between the second structure member and the preset mask.

6. The metadata management memory allocation method according to any one of claims 1 to 5, characterized in that, Before determining the number of memory pages required for metadata management based on its own memory size, the process also includes: Obtain the memory page number query message sent by the CSM terminal; Based on the requested memory page query message, determine whether it belongs to the input / output group of the all-flash thin pool to be created. If so, start the step of determining the number of memory pages required for metadata management based on its own memory size.

7. A metadata management memory allocation device, characterized in that, Any controller used in a dual-controller storage device within a multi-controller cluster, including: The memory page number determination module is used to determine the number of memory pages required for metadata management based on its own memory size. The memory page count saving module is used to update the highest bit of the first structure member, save the memory page count to the updated first structure member, and retain the value of the highest bit of the updated first structure member during the saving process; The message sending module is used to trigger the message sending mechanism to send a message carrying the updated first structure member to the CSM terminal of the multi-controller cluster, so that the CSM terminal can assign the first structure member to the second structure member and request memory based on the second structure member; After assigning the first structure member to the second structure member, the CSM terminal clears the highest bit of the second structure member and allocates memory based on the cleared second structure member.

8. An electronic device, characterized in that, Includes memory and processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program to implement the metadata management memory allocation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the metadata management memory allocation method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Operation mode of task state machine management mechanism of embedded real-time operating system

    CN101980167A

  • Multi-control storage system, data processing method and device and medium

    CN114756176A