A memory management method and device

By monitoring the memory page exception information and triggering management scripts through the monitoring process, the user process can realize real-time perception of memory page migration and update the mapping table, solve the problem of access errors caused by large page memory migration, and improve the availability of the operating system.

CN113076264BActive Publication Date: 2024-09-13ALIBABA GROUP HOLDING LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010003713.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-03
Publication Date
2024-09-13
Estimated Expiration
2040-01-03

AI Technical Summary

Technical Problem

When using large page memory, the memory page migration process is unaware of the user process, causing the mapping table from virtual memory address to physical memory address not to be updated in time, causing access errors.

Method used

The monitoring process monitors the exception information of the memory page. When the exception information reaches the threshold, the first management script is triggered to execute the instruction. After the memory page is migrated, the second management script is triggered to update the memory address mapping table of the user process to ensure the mapping relationship. consistency.

Benefits of technology

User processes can sense memory page migration operations in real time, reduce access errors, and improve the availability and stability of the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113076264B
    Figure CN113076264B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a memory management method and device, including: using a monitoring process to monitor abnormal information of accessing a memory page, the abnormal information includes abnormal information triggered when a processor finds an error; when the abnormal information of the same memory page reaches a threshold, triggering the running of a first management script through the monitoring process; and migrating the memory page whose abnormal information reaches the threshold. The above scheme can effectively reduce memory access errors caused by memory page migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a memory management method and device. Background Art

[0002] Compared with the traditional 4K page memory, the Linux operating system supports large pages of memory larger than 2M, called huge page memory. Huge page memory can improve memory management and access efficiency. When using huge page memory, the user process needs to map the file (mmap, a memory mapping file method that can map a file or object to the address space of the process) to the process virtual memory address space through the virtual file system (hugetlbfs) for use. In order to improve the conversion efficiency from virtual memory address to physical memory address, the user process needs to maintain a mapping table from virtual memory address to physical memory address.

[0003] When the physical memory corresponding to the virtual memory accessed by the process has an MCE (Machine Check Exception, an exception triggered when the CPU finds a hardware error) error and reaches a certain threshold, the operating system will migrate the corresponding problematic physical memory page and map the process virtual memory to the new physical memory to ensure the availability of memory access. However, the memory migration process is imperceptible to the user process, that is, the operating system will not inform the user process when performing memory page migration. In this way, for the use of large page memory, the mapping table from virtual memory address to physical memory address maintained by the user process itself is still based on the mapping relationship before the operating system migrates the memory page, resulting in errors when the user process accesses the physical address corresponding to the virtual address. Summary of the invention

[0004] In view of the above problems, an embodiment of the present invention provides a memory management method and device to reduce memory access errors caused by memory page migration.

[0005] To achieve the above objectives, the embodiments of the present invention mainly provide the following technical solutions:

[0006] On the one hand, an embodiment of the present invention provides a memory management method, which specifically includes:

[0007] Using the monitoring process to monitor exception information of accessing the memory page, the exception information includes exception information triggered when the processor finds an error;

[0008] When the abnormal information of the same memory page reaches a threshold, triggering the running of the first management script through the monitoring process;

[0009] The memory page whose abnormal information reaches a threshold is migrated.

[0010] On the other hand, an embodiment of the present invention provides a memory management device, specifically comprising:

[0011] A monitoring unit, used to monitor exception information of accessing a memory page using a monitoring process, wherein the exception information includes exception information triggered when a processor finds an error;

[0012] A trigger unit, configured to trigger the running of a first management script through the monitoring process when the monitoring unit monitors that the abnormal information of the same memory page reaches a threshold;

[0013] The migration unit is used to migrate the memory page whose abnormal information monitored by the monitoring unit reaches a threshold.

[0014] On the other hand, an embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the above-mentioned memory management method when running.

[0015] On the other hand, an embodiment of the present invention provides a memory management device, which includes a processor and a memory, wherein the memory is used to store programs, and the processor is coupled to the memory to run the program to execute the above-mentioned memory management method.

[0016] By means of the above technical scheme, a memory management method and device provided in an embodiment of the present invention optimize and improve memory management. When the error of a certain memory page monitored by the monitoring process reaches a certain threshold, the first management script execution instruction is first triggered, and then the memory page migration operation is performed. The execution of the first management script enables the user process to perceive the operating system's migration operation of the memory page in real time, thereby reducing access errors caused by the migration of memory pages and improving the availability and stability of the operating system.

[0017] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0019] Figure 1 A flow chart of a memory management method proposed in an embodiment of the present invention is shown;

[0020] Figure 2 A flow chart of initializing the monitoring process in an embodiment of the present invention is shown;

[0021] Figure 3 A flowchart of another memory management method proposed in an embodiment of the present invention is shown;

[0022] Figure 4 A block diagram showing a memory management device according to an embodiment of the present invention is shown;

[0023] Figure 5 A block diagram showing the composition of another memory management device proposed in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0025] A memory management method provided by an embodiment of the present invention is mainly an improved management solution for the memory address migration process, and its specific steps are as follows: Figure 1 As shown, the method includes:

[0026] Step 101: Use a monitoring process to monitor abnormal information of accessing a memory page.

[0027] Among them, the exception information includes exception information triggered when the processor finds an error, such as MCE error information. Among them, the processor is not limited to the central processing unit used in the computer, but can also be a microprocessor used in mobile phones, graphics cards or other smart appliances, and can also be a programmable logic device such as a Field-Programmable Gate Array (FPGA). In the exemplary embodiment of the present invention, taking the CPU as an example, the MCE error refers to an error discovered by the CPU. Therefore, the MCE error is not entirely caused by storage access. Therefore, this step is to create a monitoring process in the operating system, and the monitoring process is dedicated to monitoring the MCE errors discovered by the CPU regarding access to memory pages. Among them, the created monitoring process is a user-mode process (MCE daemon), which needs to be initialized when the monitoring process is enabled. The specific process is as follows. Figure 2As shown, MCE daemon will load a configuration file when it is initialized, and the configuration file includes a management script for migrating large page memory registered by the user according to needs, and the management script is divided into a management script that runs before migrating large pages (a first management script) and a management script that runs after migrating large pages (a second management script).

[0028] It should be noted that the exception information monitored in this step is the exception information of all memory pages contained in the memory, that is, each piece of exception information will record the memory page it accesses.

[0029] Step 102: When the abnormal information of the same memory page reaches a threshold, the first management script is triggered to run through the monitoring process.

[0030] When this step is executed, the number of abnormal information generated is counted based on each memory page separately, that is, the number of abnormal information generated by each memory page is accumulated according to the memory page data recorded in the abnormal information. When the number of abnormal information in a certain memory page reaches the threshold, the monitoring process will trigger the execution of the first management script. At the same time, step 103 will also be executed.

[0031] Among them, the first management script is the management script before the migration of the above-mentioned large page. By executing the first management script, the monitoring process can notify the user process of the relevant information of the memory page that needs to be migrated, preventing the user process from accessing it during the migration of the memory page. The first management script is generally defined and written by the user according to the needs of memory management. By executing the first management script, a notification is sent to the user process to prompt that the memory page needs to be migrated due to the MCE error, so as to realize the real-time perception of the user process of the operating system migrating the memory page.

[0032] Step 103: Migrate the memory pages whose abnormal information reaches the threshold.

[0033] When this step is executed, the execution order of this step and the execution order of the monitoring process triggering the first management script in step 102 is not specifically limited. When the execution time of triggering the first management script is taken into consideration, in order to avoid the situation where the memory page is migrated first, resulting in the user process being unable to perceive it in time, causing the user process to still use the wrong memory address comparison table to access the memory page and causing an access error, this embodiment will first execute the operation of triggering the first management script and then execute the operation of migrating the memory page in actual applications.

[0034] It can be seen from the above examples that a memory management method provided by an embodiment of the present invention is to first trigger a script execution instruction and then execute the memory page migration operation when the MCE error of a certain memory page monitored by the monitoring process reaches a certain threshold. The execution of the script enables the user process to perceive the operating system's migration operation of the memory page in real time, thereby reducing access errors caused by the migration of memory pages and improving the availability and stability of the operating system.

[0035] Above Figure 1 In the embodiment shown, by triggering the running of the first management script, the user process can effectively perceive the migration operation of the operating system on the memory page. In order to ensure that the user process does not encounter errors due to the migration of memory pages when accessing the memory, the present invention further implements the updating of the memory address comparison table maintained by the user process through a preferred embodiment. The specific steps are as follows: Figure 3 As shown, including:

[0036] Step 201: Use a monitoring process to monitor abnormal information of accessing a memory page.

[0037] Step 202: Determine whether the amount of abnormal information of the same memory page reaches a threshold.

[0038] If yes, execute step 203; if no threshold is reached, execute step 201.

[0039] Step 203: Trigger the running of the first management script by monitoring the process.

[0040] Step 204: Migrate the memory pages whose abnormal information reaches the threshold.

[0041] Step 205: After completing the memory page migration, the monitoring process triggers the execution of the second management script.

[0042] The user process updates the memory address mapping table according to the execution result of the second management script, and the memory address mapping table records the mapping relationship between the virtual memory address and the physical memory address.

[0043] In the above embodiment, the contents of steps 201 to 204 are the same as Figure 1The contents of the illustrated embodiments are the same, and step 205 is that after the operating system completes the memory page migration, the monitoring process triggers the operation of a management script after the migration of a large page, that is, the second management script. It should be noted that the second management script corresponds to the first management script. In the embodiment of the present invention, the main function of the first management script is not only to prompt the user process that there is an operation of migrating memory pages, but also to allow the user process to interrupt the access to the migrated memory pages. In this way, the problem of memory access errors in the user process during the process of migrating memory pages can be avoided. Since the user process interrupts the memory access according to the execution result of the first management script, in order to ensure the normal execution of the user process, it is necessary to restore the user process's access to the memory by executing the second management script after completing the memory page migration. Corresponding to the second management script, the user process can update the mapping table according to the interrupt recovery instruction obtained by running the second management script, so as to ensure that the memory address mapping table maintained by itself is consistent with the memory address mapping relationship in the operating system. In this way, the user process avoids memory access errors caused by migrating memory pages after restoring memory access.

[0044] Furthermore, in order to enable the monitoring process to trigger the running of the first management script and the second management script before and after executing the operation of migrating the memory page when the number of MCE errors of the memory page detected by the monitoring process reaches a threshold, in a preferred embodiment of the present invention, it is also necessary to load a configuration file with management script registration items for the monitoring process when the monitoring process is initialized. That is, in the configuration file for initializing the monitoring process, a management script registration item is added. Through the management script registration item, the execution script triggered when the number of MCE errors of the memory page detected by the monitoring process reaches a threshold, that is, the first management script, can be specified, and the execution script triggered after the memory page migration is completed, that is, the second management script, can also be specified at the same time. Among them, the management script registration item includes at least two items: a first management script registration item and a second management script registration item. When the second management script does not need to be executed, the two items of the second management script registration item can be set by default.

[0045] In addition, according to actual needs, there is no specific limitation on the number of scripts registered in the management script registration item, that is, multiple scripts can be registered simultaneously for the first management script registration item or the second management script registration item.

[0046] Furthermore, the management scripts registered in the configuration file can be customized by the user according to the needs of the actual application scenarios. Therefore, before initializing the monitoring process, it is also necessary to receive the first management script and the second management script written by the user, so that when the monitoring process triggers the management script, the corresponding management script can be accurately called and executed. Among them, the preset scenarios proposed in the embodiments of the present invention are: the scenarios that can be applied to the first management script are one or more of notifying the user process, logging, and interrupting the user process; the scenarios that can be applied to the second management script are restarting the user process and / or restoring the interrupted user process, etc. That is to say, in the embodiments of the present invention, the first management script and the second management script can be a general management script applied to multiple scenarios, or a management script dedicated to a certain scenario.

[0047] For application scenarios such as notification and logging, the main purpose is to inform the user process so that it can perceive the operating system migration memory page in real time. In this regard, since there is no need to update the memory address mapping relationship in the user process, only the first management script can be set in the configuration file to execute Figure 1 The specific steps of the embodiment shown in the figure are used to implement memory management. For application scenarios such as interrupting, restarting a user process, or updating the memory address mapping relationship of a user process, the main purpose is to ensure the accuracy of the memory address mapping relationship within the user process. To this end, it is necessary to set the first management script and the second management script in the configuration file at the same time. Figure 3 The specific steps of the illustrated embodiment are used to implement memory management.

[0048] Furthermore, in order to ensure accurate execution of the monitoring process and avoid errors in user process execution due to incorrect settings of the management script registration item in the configuration file, in a preferred embodiment of the present invention, the content of the configuration file is also detected and analyzed to ensure that the configuration file accurately registers the management script in a specific application scenario. The specific implementation includes:

[0049] When loading the configuration file, the preset scenario applied by the first management script is determined. The determination can be achieved by analyzing the content or tag information of the first management script, wherein the tag information is used to mark the application scenario of the first management script.

[0050] If it is determined that the preset scenario applied by the first management script is to interrupt the user process, it means that not only the first management script registration item but also the second management script registration item needs to be registered in the configuration file. At this time, the configuration file will be further checked whether there is a registration item for the second management script.

[0051] If it exists, it means that the configuration file is correct. Otherwise, if it does not exist, it means that the configuration file is wrong and needs to be changed. At this time, an alarm message will be triggered and the operation of loading the configuration file will be interrupted.

[0052] Furthermore, in executing the above Figure 1 or Figure 3 In the step of using the monitoring process to monitor the abnormal information of accessing the memory page, the abnormal information includes the abnormal information triggered when the processor finds a hardware error. The specific implementation of the embodiment of the present invention includes: the central processing unit classifies the abnormal information according to the hardware type, and then the monitoring process obtains the abnormal information caused by accessing the memory page according to the classification result.

[0053] Among them, the classification of hardware types includes hardware devices such as CPU, motherboard, hard disk, memory, network card, etc., and these hardware may trigger MCE errors during operation. At this time, the CPU will classify the hardware according to the MCE error. The monitoring process in the embodiment of the present invention is mainly used to monitor MCE errors involving memory, and will perform separate statistics based on the specific memory pages accessed in the MCE error to determine whether the MCE error occurring in a memory page reaches the threshold.

[0054] Furthermore, as a response to the above Figure 1 , Figure 3 In order to realize the method shown in the figure, the embodiment of the present invention provides a memory management device, which is mainly used to prompt the user process operating system to perform memory page migration operations, thereby reducing memory access errors caused by memory page migration. For ease of reading, this device embodiment will no longer repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. The device is as follows Figure 4 As shown, specifically including:

[0055] A monitoring unit 31, configured to monitor exception information of accessing a memory page by using a monitoring process, wherein the exception information includes exception information triggered when a processor finds a hardware error;

[0056] The trigger unit 32 is used to trigger the monitoring process to run the first management script when the monitoring unit 31 monitors that the abnormal information of the same memory page reaches a threshold;

[0057] The migration unit 33 is used to migrate the memory pages whose abnormal information monitored by the monitoring unit 31 reaches a threshold.

[0058] Further, such as Figure 5As shown, the trigger unit 32 is further used to trigger the running of the second management script through the monitoring process after the migration unit 33 completes the memory page migration, and the user process updates the memory address mapping relationship according to the execution result of the second management script.

[0059] Further, such as Figure 5 As shown, the device also includes:

[0060] The initialization unit 34 is used to load a configuration file having a management script registration item when initializing the monitoring process, and register the first management script and the second management script through the management script registration item.

[0061] Further, such as Figure 5 As shown, the device also includes:

[0062] The receiving unit 35 is used to receive the first management script written according to a preset scenario, wherein the preset scenario at least includes notifying a user process, logging, and interrupting a user process;

[0063] The receiving unit 35 is further configured to receive the second management script written according to a preset scenario, wherein the preset scenario at least includes restarting a user process and restoring an interrupted user process.

[0064] Further, such as Figure 5 As shown, the initialization unit 34 includes:

[0065] A determination module 341 is used to determine the preset scenario applied by the first management script when loading the configuration file;

[0066] A detection module 342, configured to detect whether there is a registration item of a second management script in the configuration file if the judgment module 341 determines that the preset scenario is to interrupt the user process;

[0067] The alarm module 343 is configured to trigger an alarm message if the detection module 342 determines that there is no registration item of the second management script.

[0068] Further, such as Figure 5 As shown, the exception information includes exception information triggered when the processor finds a hardware error, and the monitoring unit 31 includes:

[0069] A classification module 311, configured to classify the abnormal information according to the hardware type by the processor;

[0070] The acquisition module 312 is used to monitor the process and acquire the exception information caused by accessing the memory page according to the classification of the classification module 311.

[0071] To sum up, a memory management method and device provided by an embodiment of the present invention is to modify a configuration file and add a management script registration item therein when initializing a monitoring process, so that when the MCE error of a certain memory page monitored by the monitoring process reaches a certain threshold, a script execution instruction is first triggered, and then the memory page migration operation is performed. By executing the script, the user process is able to perceive the operating system's migration of memory pages in real time. Moreover, after executing the memory page migration operation, a script execution instruction can be triggered again, and the memory address mapping relationship maintained by the user process itself can be updated through the later-executed script to ensure that the mapping relationship is consistent with the correspondence between the virtual memory address and the physical memory address after the operating system migrates the memory page, thereby reducing access errors caused by errors in the mapping relationship and improving the availability of the operating system.

[0072] Furthermore, an embodiment of the present invention further provides a processor, the processor being used to run a program, wherein when the program is run, the following is performed: Figure 1 or Figure 3 The memory management method described.

[0073] In addition, an embodiment of the present invention further provides a memory management device, which includes a processor and a memory, wherein the memory is used to store a program, and the processor is coupled to the memory to run the program to execute the following steps: Figure 1 or Figure 3 The memory management method described.

[0074] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0075] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, and do not represent the advantages and disadvantages of the embodiments.

[0076] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0077] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0078] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

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

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

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

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

[0083] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0084] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0085] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

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

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

[0088] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A memory management method, characterized in that: include: Using the monitoring process to monitor exception information of accessing the memory page, the exception information includes exception information triggered when the processor finds an error; When the abnormal information of the same memory page reaches a threshold, the monitoring process is used to trigger the running of a first management script to prompt the user process that the memory page needs to be migrated due to the abnormality, so that the user process interrupts access to the memory page; Migrating the memory page whose abnormal information reaches a threshold; After completing the memory page migration, triggering the running of the second management script through the monitoring process to restore the user process's access to the memory page; The user process updates a memory address mapping relationship according to an execution result of the second management script, wherein the memory address mapping relationship records a mapping relationship from a virtual memory address to a physical memory address.

2. The method according to claim 1, characterized in that The method further comprises: When initializing the monitoring process, loading a configuration file having a management script registration item; The first management script and the second management script are registered through the management script registration item.

3. The method according to claim 2, characterized in that The method further comprises: Receiving the first management script written according to a preset scenario, wherein the preset scenario at least includes one or more of notifying a user process, logging, and interrupting a user process; The second management script written according to a preset scenario is received, where the preset scenario at least includes restarting a user process and / or restoring an interrupted user process.

4. The method according to claim 3, characterized in that The method further comprises: When loading the configuration file, determining the preset scenario to which the first management script is applied; If the preset scenario is to interrupt the user process, detecting whether there is a registration item of the second management script in the configuration file; If it does not exist, an alarm message will be triggered.

5. The method according to any one of claims 1 to 4, characterized in that The exception information includes exception information triggered when the processor finds a hardware error; The method of using the monitoring process to monitor the abnormal information of accessing the memory page includes: The processor classifies the abnormal information according to the hardware type; The monitoring process obtains exception information caused by accessing the memory page according to the classification.

6. A memory management device, characterized in that: The device comprises: A monitoring unit, used to monitor exception information of accessing a memory page using a monitoring process, wherein the exception information includes exception information triggered when a processor finds an error; A trigger unit, configured to trigger the running of a first management script through the monitoring process when the monitoring unit monitors that the abnormal information of the same memory page reaches a threshold, so as to prompt the user process that the memory page needs to be migrated due to the abnormality, so that the user process interrupts access to the memory page; A migration unit, configured to migrate the memory page whose abnormal information monitored by the monitoring unit reaches a threshold; The trigger unit is also used to trigger the running of the second management script through the monitoring process after completing the memory page migration to restore the user process's access to the memory page; the user process updates the memory address mapping relationship according to the execution result of the second management script, and the memory address mapping relationship records the mapping relationship from the virtual memory address to the physical memory address.

7. The device according to claim 6, characterized in that The device also includes: The initialization unit is used to load a configuration file having a management script registration item when initializing the monitoring process, and register the first management script and the second management script through the management script registration item.

8. The device according to claim 7, characterized in that The device also includes: A receiving unit, configured to receive the first management script written according to a preset scenario, wherein the preset scenario at least includes one or more of notifying a user process, logging, and interrupting a user process; The receiving unit is further configured to receive the second management script written according to a preset scenario, wherein the preset scenario at least includes restarting a user process and / or restoring an interrupted user process.

9. The device according to claim 8, characterized in that The initialization unit comprises: A determination module, used to determine the preset scenario applied by the first management script when loading the configuration file; A detection module, configured to detect whether there is a registration item of a second management script in the configuration file if the judgment module determines that the preset scenario is to interrupt the user process; The alarm module is used to trigger an alarm message if the detection module determines that there is no registration item of the second management script.

10. The device according to any one of claims 6 to 9, characterized in that: The exception information includes exception information triggered when the processor finds a hardware error; The monitoring unit comprises: A classification module, configured to classify the abnormal information according to the hardware type by the central processing unit; The acquisition module is used for the monitoring process to acquire the abnormal information caused by accessing the memory page according to the classification of the classification module.

11. A processor, characterized in that: The processor is used to run a program, wherein the program executes the memory management method according to any one of claims 1 to 5 when running.

12. A memory management device, characterized in that: include: Memory, used to store programs; A processor, coupled to the memory, is used to run the program to execute the memory management method as described in any one of claims 1-5.

13. A computer program product, characterized in that The computer program product includes computer program codes, and when the computer program codes are executed on a computer, the computer is enabled to implement the memory management method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Memory migration method, memory migration device and equipment

    CN103324582A

  • Parallel system local migration fault-tolerant method based on difference recognition

    CN105468457A

  • Multi-version program coexistence method and apparatus for big memory service

    CN105653328A

  • Method and system for collecting memory error event based on linux system

    CN106126364A

  • Memory, storage system, host and data operation and garbage collection method

    CN110018966A