CN112256997A - Page management method, page management device, storage medium and electronic equipment - Google Patents

Page management method, page management device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112256997A
CN112256997A CN202011253365.7A CN202011253365A CN112256997A CN 112256997 A CN112256997 A CN 112256997A CN 202011253365 A CN202011253365 A CN 202011253365A CN 112256997 A CN112256997 A CN 112256997A
Authority
CN
China
Prior art keywords
page
linked list
managed
unrecoverable
unrecyclable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011253365.7A
Other languages
Chinese (zh)
Inventor
李培锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011253365.7A priority Critical patent/CN112256997A/en
Publication of CN112256997A publication Critical patent/CN112256997A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a page management method, a page management device, a computer-readable storage medium and an electronic device, and relates to the technical field of computers. The page management method comprises the following steps: acquiring a page to be managed from a page linked list; if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable page linked list; and carrying out page recycling management based on the unrecyclable page linked list. The method and the device can effectively manage the memory pages so as to improve the accuracy and effectiveness of page recovery.

Description

Page management method, page management device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a page management method, a page management apparatus, a computer-readable storage medium, and an electronic device.
Background
With the development of computer technology, the requirements of people on system performance are gradually increased, and in order to ensure that the system has enough memory to be used, the system of the electronic device usually recycles some memory pages under certain conditions to reuse resources.
In the prior art, when the memory pages are recycled, the memory pages with lower use frequency at the tail part of the page linked list are eliminated based on the use frequency of the memory pages. However, in practical applications, when a certain memory page fails to be recycled, the memory page is usually put to the head of the linked list, and the page recycling process is executed again, so that the recycling period of the memory page is increased, the waste of the memory resource of the computer is caused, and the system performance is affected.
Therefore, how to adopt an effective memory page management method is an urgent problem to be solved in the prior art.
Disclosure of Invention
The disclosure provides a page management method, a page management device, a computer-readable storage medium and an electronic device, thereby improving the efficiency and system performance of page management at least to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a page management method, including: acquiring a page to be managed from a page linked list; if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable page linked list; and carrying out page recycling management based on the unrecyclable page linked list.
According to a second aspect of the present disclosure, there is provided a page management apparatus including: the page acquisition module is used for acquiring a page to be managed from a page linked list; the page inserting module is used for inserting the page to be managed into the unrecyclable page linked list if the page to be managed is determined to be the unrecyclable page; and the page management module is used for carrying out page recycling management based on the unrecyclable page linked list.
According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described page management method.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the above-described page management method via execution of the executable instructions.
The technical scheme of the disclosure has the following beneficial effects:
according to the page management method, the page management device, the computer readable storage medium and the electronic equipment, obtaining a page to be managed from a page linked list; if the page to be managed is determined to be the non-recyclable page, inserting the page to be managed into a non-recyclable page linked list; and carrying out page recycling management based on the unrecyclable page linked list. On one hand, the exemplary embodiment provides a new page management method, by setting an unrecoverable page linked list, when determining that a page to be managed is an unrecoverable page, the page to be managed is inserted into the unrecoverable page linked list for page recovery management, so that the problems that in the prior art, the page recovery period is long and the system performance is affected due to the fact that the unrecoverable page is placed in the page linked list again for recovery are avoided; on the other hand, the page recovery management is carried out based on the unrecyclable page linked list, so that a memory page closer to the least recently used memory can be selected during page recovery, the logic of page recovery is optimized, and the page recovery process is more accurate and effective.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 shows a schematic diagram of an electronic device of the present exemplary embodiment;
FIG. 2 illustrates a flow chart of a page management method of the present exemplary embodiment;
FIG. 3 illustrates a sub-flow diagram of a page management method of the present exemplary embodiment;
FIG. 4 is a flowchart illustrating a method for page management in which the page linked list is an active page linked list in the exemplary embodiment;
FIG. 5 is a flowchart illustrating a method for page management in which the page linked list is an inactive page linked list in the exemplary embodiment;
FIG. 6 is a flowchart illustrating page reclamation when a page linked list is an active page linked list in the exemplary embodiment;
FIG. 7 is a flowchart illustrating page reclamation when a page linked list is an inactive page linked list in the exemplary embodiment;
fig. 8 shows a block diagram of a structure of a page management apparatus of the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In a related art page management method, a memory page is recycled based on an LRU (Least Recently Used) algorithm, for example, when a Linux kernel native LRU algorithm manages the memory page, the method may include two linked lists: an active page linked list; a linked list of inactive pages. When a user accesses a memory page, the memory page is placed at the head of an active page linked list to indicate that the memory page is in an active state, the memory page which is not accessed for a long time is pushed to the tail of the active page linked list along with the increase of the active page, and if the memory is in shortage, part of the memory page at the tail of the active page linked list is replaced into an inactive page linked list; the memory pages in the inactive page linked list are also the same rule, the longer the memory pages which are not accessed, the longer the memory pages are pushed to the tail of the linked list, and finally the eliminated memory pages are determined from the tail of the inactive page linked list. That is, the less frequently used pages should be gradually pushed to the tail of the page linked list for page reclamation. However, in practical applications, a situation that the page recovery fails may occur, and at this time, the page whose recovery fails will be moved to the head of the page linked list. Then the life cycle of the page existing in the linked list must again go through the process of pushing from the head of the linked list to the tail of the linked list. In the process, the probability of the page being accessed is possibly lower, and the influence on the performance of the system is large.
Based on the above problems, the present exemplary embodiment provides a new page management method, which can effectively manage pages to improve system performance and page recovery efficiency. The page management method provided by the embodiment of the present disclosure may be executed by a terminal device, or may be executed by a server, which is not limited by the present disclosure.
An exemplary embodiment of the present disclosure provides an electronic device for implementing a page management method. The electronic device includes at least a processor and a memory for storing executable instructions of the processor, the processor being configured to perform the page management method via execution of the executable instructions.
An electronic device 100 according to such an exemplary embodiment of the present disclosure is described below with reference to fig. 1. The electronic device 100 shown in fig. 1 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in FIG. 1, electronic device 100 is embodied in the form of a general purpose computing device. The components of the electronic device 100 may include, but are not limited to: the at least one processing unit 110, the at least one memory unit 120, a bus 130 connecting different system components (including the memory unit 120 and the processing unit 110), and a display unit 140.
Where the storage unit stores program code, the program code may be executed by the processing unit 110 to cause the processing unit 110 to perform the steps according to various exemplary embodiments of the present disclosure as described in the above section "exemplary methods" of this specification. For example, the processing unit 110 may perform the steps shown in fig. 2, 3, 4, 5, 6, or 7, and so on.
The storage unit 120 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)121 and/or a cache memory unit 122, and may further include a read only memory unit (ROM) 123.
Storage unit 120 may also include a program/utility 124 having a set (at least one) of program modules 125, such program modules 125 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 130 may be any one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 100 may also communicate with one or more external devices 170 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 100, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 100 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interfaces 150. Also, electronic device 100 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 160. As shown, the network adapter 160 communicates with the other modules of the electronic device 100 over the bus 130. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiments of the present disclosure.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
The following specifically describes a page management method and a page management apparatus according to exemplary embodiments of the present disclosure.
Fig. 2 shows a flow of a page management method in the present exemplary embodiment, which includes the following steps S210 to S230:
step S210, obtaining the page to be managed from the page linked list.
Generally, a system may manage a memory in units of a page form, where a page refers to a block of storage space, which may be expressed in a file form, for storing data information. In order to ensure that the system has enough memory to use, the system usually recycles the page periodically or under some trigger conditions, and releases the memory space to reuse the memory page and write new data information. In this exemplary embodiment, the page to be managed is a memory page to which data information has been written, which may be eliminated or needs to be subjected to memory release, and the page is often a page that is not accessed by the user within a preset time, for example, a memory page that is not accessed within a week; or in a period of time, the user accesses a certain memory page, for example, the user accesses a certain memory page, and then none of the 100 memory pages accessed later contains the memory page, it may be considered that the user has no temporary demand for the data information of the memory page, and it may be considered that the memory is released to make up a new memory space.
The page linked list refers to a storage structure for storing the memory pages, and according to the types of the memory pages stored in the page linked list, in an exemplary embodiment, the page linked list may include an active page linked list and an inactive page linked list. The memory pages stored in the active page linked list are memory pages recently accessed by the user or memory pages which are accessed regularly, namely active pages; the memory pages stored in the inactive page linked list are memory pages which have low access frequency and are not accessed by the user recently or for a long time, namely inactive pages. The inactive page and the active page are relative concepts, when a user accesses a certain memory page, the memory page can be added into an active page linked list, at the moment, the memory page is the active page, and when the memory page is moved out of the active page linked list and added into the inactive page linked list, the memory page is converted into the inactive page.
In the exemplary embodiment, the page to be managed may be obtained from an active page linked list, for example, a memory page frequently accessed by a user is first added to the active page linked list, and the page to be managed may be obtained from the active page linked list; the page to be managed can also be obtained from the inactive page linked list, for example, when the use frequency of the memory page in the active page linked list is reduced and then the memory page is moved to the inactive page linked list, the page to be managed can also be obtained from the inactive page linked list, that is, the page to be managed can be an active page or an inactive page, and the page recovery management process has certain difference according to different types of the page to be managed.
In the present exemplary embodiment, the above step S310 may include:
and acquiring the page to be managed from the tail part of the page linked list.
In this exemplary embodiment, the page linked list may store the memory pages according to a certain policy, for example, the obtained new memory page is first placed at the head of the page linked list, after the added memory pages are added, the memory page that is not accessed by the user again may be pushed to the tail of the page linked list, and the memory page at the tail of the linked list is less active, and one or more pages to be managed may be obtained from the tail of the page linked list.
In addition, the management modes of the page linked list may include multiple modes, for example, the pages may be sorted by a FIFO (First Input First Output, First in First out) mode, the obtained new memory pages are sequentially arranged according to the obtained timestamps, the timestamps are placed in an area close to the tail in the page linked list and far from the current time, the timestamps are placed in an area close to the head in the page linked list and near to the current time, and then the pages to be managed are obtained from the tail of the page linked list, that is, the memory pages with the timestamps far from the current time are obtained. In addition, the pages in the page linked list can be managed in an LRU manner and sorted, which is not specifically limited by the present disclosure.
In step S220, if it is determined that the page to be managed is the unrecyclable page, the page to be managed is inserted into the unrecyclable page linked list.
When the page recovery is performed, firstly, the memory page to be recovered may be determined by a certain algorithm, for example, when the memory page at the tail of the page linked list is determined to perform the page recovery, all the linear addresses mapped to the memory page to be recovered are found, and the page recovery is performed. However, in the actual recycling process, not every memory page to be recycled can be successfully recycled, for example, in a specific application scenario, a user performs unrecoverable custom setting on some memory pages, and when the system recycles the memory pages, the memory pages cannot be successfully recycled; or in other application scenarios, there are some edited or modified memory pages, and the edited or modified contents of the memory pages are not stored yet, so that to avoid information loss, the memory pages cannot be successfully recycled, and the like. When the memory page is determined to be an unrecoverable page, the system sets unrecoverable identification information for the memory page so as to determine the type of the memory page based on the identification information. Generally, when a page to be managed is an unrecoverable page, the prior art relocates the page to the head of the page linked list and re-executes the process of pushing the page to the tail of the page linked list. In the exemplary embodiment, the page to be managed determined as the unrecoverable page may be inserted into the unrecoverable page linked list for page management. The unrecoverable page linked list is a linked list structure which is additionally arranged, is different from the active page linked list and the inactive page linked list and is used for storing the unrecoverable pages. It should be noted that the management manner of the unrecyclable page linked list is similar to the management manner of the page linked list, and a FIFO or LRU manner may also be adopted, which is not specifically limited in the present disclosure.
In an exemplary embodiment, as shown in fig. 3, in the step S220, inserting the page to be managed into the non-recyclable page linked list may include the following steps:
step S310, if the page to be managed is determined to be an anonymous page, inserting the page to be managed into an unrecoverable page linked list of the anonymous page;
in step S320, if it is determined that the page to be managed is a document page, the page to be managed is inserted into the unrecyclable page linked list of the document page.
The anonymous page refers to a heap memory dynamically allocated by an application program; the file page refers to a file mapping page obtained through memory mapping except for a cache and a buffer area. In consideration of the fact that the types of the memory pages are different in practical application, in order to facilitate effective management of the memory pages, the exemplary embodiment may additionally add two different unrecoverable page linked lists, which are respectively an unrecoverable page linked list of an anonymous page and an unrecoverable page linked list of a file page. When the page to be managed is inserted into the unrecyclable page linked list, the page to be managed can be inserted into the corresponding unrecyclable page linked list through judging the page identifier, and if the page to be managed is determined to be an anonymous page, the page to be managed is inserted into the unrecyclable page linked list of the anonymous page; and if the page to be managed is a file page, inserting the page to be managed into an unrecoverable page linked list of the file page.
In an exemplary embodiment, when the page linked list is an active page linked list, the step S220 may include:
if the page to be managed is determined to be the unrecyclable page, inserting the page to be managed into an unrecyclable active page linked list;
further, the page management method may further include:
and if the page to be managed is determined to be a recyclable page, inserting the page to be managed into the inactive page linked list.
The recyclable page refers to a memory page that can be successfully recycled, and is a concept opposite to the non-recyclable page. In addition, in the exemplary embodiment, two types of unrecoverable page linked lists, namely an unrecoverable active page linked list and an unrecoverable inactive page linked list, may be respectively set, so as to correspondingly insert different types of pages to be managed into the corresponding unrecoverable page linked lists for page management. Specifically, when the page linked list is an active page linked list, if the page to be managed is determined to be an unrecoverable page, the page to be managed needs to be inserted into the unrecoverable active page linked list, and if the page to be managed is determined to be a recyclable page, the page to be managed can be inserted into the inactive page linked list, so that page management can be performed on the inactive page based on the inactive page linked list subsequently.
Fig. 4 is a flowchart illustrating a page management method in which a page linked list is an active page linked list, which may specifically include the following steps:
step S410, acquiring a page to be managed from an active page linked list;
step S420, judging whether the page to be managed is a recyclable page;
step S430, if the page to be managed is a recyclable page, inserting the page to be managed into an inactive page linked list;
step S440, if the page to be managed is the unrecyclable page, judging the page type of the page to be managed;
step S450, if the page to be managed is an anonymous page, inserting the page to be managed into an unrecoverable active page linked list of the anonymous page;
in step S460, if the page to be managed is a document page, the page to be managed is inserted into the unrecyclable active page linked list of the document page.
In the above S440, the page type of the page to be managed may be determined by determining the page identifier of the page to be managed. In the exemplary embodiment, when the page to be managed is an active page, an unrecoverable page which is not placed in an inactive page linked list is not available, and an unrecoverable active page linked list of an anonymous page and an unrecoverable active page linked list of a file page can be respectively placed based on different page types; on the other hand, the management efficiency and effectiveness of the memory pages can be further improved by respectively setting the unrecoverable page linked lists of the anonymous pages and the file pages.
In an exemplary embodiment, when the page linked list is an inactive page linked list, the step S220 may include:
if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable inactive page linked list;
further, the page management method may further include:
and if the page to be managed is determined to be the recyclable page, performing page recycling on the page to be managed.
In the exemplary embodiment, if the page to be managed is obtained from the inactive page linked list, the subsequent page management process may be determined by determining whether the page to be managed is a recyclable page. Generally, the use frequency of the memory pages which are stored in the inactive page linked list is low and can be eliminated, and if the pages to be managed are recoverable pages, the pages to be managed can be directly recovered; if the page to be managed is the non-recoverable page, the page to be managed can be inserted into the non-recoverable inactive page linked list to manage the non-recoverable page. It should be noted that, when the page to be managed is inserted into the unrecoverable inactive page linked list, it may also be determined, according to the type of the page to be managed, whether to insert the page to be managed into the unrecoverable inactive page linked list of the anonymous page or the unrecoverable inactive page linked list of the file page.
Fig. 5 is a flowchart illustrating a page management method in which a page linked list is an inactive page linked list, which may specifically include the following steps:
step S510, acquiring a page to be managed from an inactive page linked list;
step S520, judging whether the page to be managed is a recyclable page;
step S530, if the page to be managed is a recyclable page, page recycling is carried out on the page to be managed;
step S540, if the page to be managed is the unrecyclable page, judging the page type of the page to be managed;
step S550, if the page to be managed is an anonymous page, inserting the page to be managed into an unrecoverable inactive page linked list of the anonymous page;
step S560, if the page to be managed is a document page, the page to be managed is inserted into the unrecyclable inactive page linked list of the document page.
With reference to the above flow methods in fig. 4 and fig. 5, it can be seen that, in the exemplary embodiment, when setting the unrecyclable page linked list, the method may be considered from two aspects, on one hand, considering from an active page and an inactive page, setting the unrecyclable active page linked list and the unrecyclable inactive page linked list; on the other hand, based on different page types, the unrecoverable active page linked list and the unrecoverable inactive page linked list are further refined and classified so as to store targeted memory pages under different application requirements, and therefore the management efficiency of the memory pages is improved.
And step S230, carrying out page recycling management based on the unrecyclable page linked list.
In this exemplary embodiment, the recovery order of the memory pages may be determined according to the release order of the unrecoverable page linked list, so as to perform page recovery, for example, the memory pages may be recovered from the head or the tail of the unrecoverable page linked list.
In an exemplary embodiment, the step S230 may include:
and when the preset recovery condition is met, recovering the page from the head or the tail of the unrecoverable page linked list.
The preset recovery condition is a judgment condition used for determining whether to trigger the recovery of the page in the unrecyclable page linked list at present. After the memory pages are placed into the unrecoverable page list, the system may continue to perform memory reclamation due to memory strain or other factors, and the memory pages that have been placed into the unrecoverable page list may also transition from the unrecoverable state to the reclaimable state. Thus, the system may attempt to reclaim from a linked list of non-recyclable pages. When the preset recovery condition is met, the system can try to recover the memory pages in the non-recoverable page linked list in preference to the non-active page linked list or other linked lists, otherwise, if the preset recovery condition is not met, the pages in the non-recoverable page linked list are not recovered, so that the system pressure is avoided being too high.
In an exemplary embodiment, the preset condition may include any one of:
the current time for recovering the page exceeds a first threshold value from the insertion time of the page to be recovered in the unrecyclable page linked list;
when the current page recovery is carried out, the distance between the page to be recovered and the page to be recovered is inserted into the unrecyclable page linked list, and the number of turns for carrying out the page recovery in the middle exceeds a second threshold value;
the number of the pages in the current unrecyclable page linked list reaches a third threshold value;
the memory occupancy in the system reaches a fourth threshold.
The page to be recycled is the memory page which is determined from the non-recyclable page linked list and needs to be recycled currently. In the exemplary embodiment, when the distance between the time when the page to be recycled is placed in the non-recyclable page linked list and the current recycling time is greater than a first threshold, recycling of the page to be recycled may be triggered. In addition, in addition to performing page recycling from the unrecoverable page linked list, the exemplary embodiment may also perform page recycling from the inactive linked list, and therefore, when the number of turns of page recycling performed in the middle exceeds the second threshold value after the page to be recycled is placed in the unrecoverable page linked list.
Further, in order to reasonably and effectively store the pages in the unrecoverable page linked list and avoid overlarge storage pressure, the exemplary embodiment may further set a third threshold, and when the number of the pages in the unrecoverable page linked list reaches the third threshold, the pages may be retrieved from the unrecoverable page linked list. The third threshold may be set by user as needed, for example, the total number of the memory pages that can be stored in the unrecyclable page linked list is determined, and the number of eighty percent of the total number is used as the third threshold.
The memory occupancy rate refers to the memory overhead occupied by the current process of the system, and it is considered that when the memory occupancy rate is high, the overall performance of the system may be affected. Therefore, whether page recovery is triggered or not can be determined by judging the memory occupancy rate, and when the memory occupancy rate in the system reaches a fourth threshold value, the recovery of the pages in the unrecyclable page linked list is triggered, and the like.
It should be noted that, in the exemplary embodiment, the page recycling management flows of the unrecoverable active page linked list and the unrecoverable inactive page linked list are different. Fig. 6 shows a page recycling flow chart in which the page linked list is an active page in the exemplary embodiment, which specifically includes the following steps:
step S602, judging whether a preset recovery condition is reached;
step S604, if the preset recovery condition is reached, acquiring the page to be recovered from the unrenewable active page linked list;
step S606, judging whether the page to be recovered is a recoverable page;
step S608, if the page to be recovered is a recoverable page, inserting the page to be recovered into the inactive page linked list;
if the page to be recycled is the non-recyclable page, jumping to step S610;
step S610, acquiring a page to be managed from an active page linked list;
step S612, judging whether the page to be managed is a recyclable page;
step S614, if the page to be managed is a recyclable page, inserting the page to be managed into an inactive page linked list;
step S616, if the page to be managed is the non-recyclable page, judging the page type of the page to be managed;
step 618, if the page to be managed is an anonymous page, inserting the page to be managed into an unrecoverable active page linked list of the anonymous page;
step S620, if the page to be managed is a file page, the page to be managed is inserted into the unrecyclable active page linked list of the file page.
In step S602, if the preset recycling condition is not met currently, the pages in the unrecyclable active page linked list may not be managed, but the pages in the active page linked list may be managed, and it is determined whether a memory page into which the inactive page linked list may be inserted exists in the active page linked list or whether a page into which the unrecyclable active page linked list needs to be inserted exists. In addition, when the page to be recycled is obtained from the unrecoverable active page linked list, the obtaining may specifically be to obtain from the unrecoverable active page linked list of the anonymous page, or may also be to obtain from the unrecoverable active page linked list of the file page, and the recycling process is similar, which is not specifically limited by the present disclosure.
Fig. 7 shows a page recycling flow chart in which the page linked list is an inactive page in the exemplary embodiment, which may specifically include the following steps:
step S702, inserting the pages in the active page linked list into the inactive page linked list;
step S704, judging whether a preset recovery condition is reached;
step S706, if a preset recovery condition is reached, acquiring a page to be recovered from the unrenewable inactive page linked list;
step 708, judging whether the page to be recycled is a recyclable page;
step S710, if the page to be recovered is a recoverable page, recovering the page to be recovered;
if the page to be recycled is an unrecyclable page, jumping to step S712;
step S712, acquiring a page to be managed from the inactive page linked list;
step 714, judging whether the page to be managed is a recyclable page;
step S716, if the page to be managed is a recyclable page, recycling the page to be managed;
step S718, if the page to be managed is the unrecyclable page, judging the page type of the page to be managed;
step S720, if the page to be managed is an anonymous page, inserting the page to be managed into an unrecoverable inactive page linked list of the anonymous page;
in step S722, if the page to be managed is a file page, the page to be managed is inserted into the unrecyclable inactive page linked list of the file page.
In step S704, if the preset recovery condition is not met, the pages in the non-recoverable inactive page linked list may not be recovered, but the pages in the inactive page linked list may be managed, and it is determined whether a memory page that can be recovered exists in the inactive page linked list or whether a page that needs to be inserted into the non-recoverable inactive page linked list exists. In addition, when the page to be recycled is obtained from the unrecyclable inactive page linked list, the obtaining may specifically be obtained from the unrecyclable inactive page linked list of the anonymous page, or may also be obtained from the unrecyclable inactive page linked list of the file page, and the recycling process is similar, which is not specifically limited by the present disclosure.
It should be noted that the recovery flow of the unrecoverable active page linked list is similar to the recovery flow of the unrecoverable active page linked list, and the difference is that when the memory page in the unrecoverable active page linked list is subjected to recovery management, when the memory page to be recovered is a recoverable page, the memory page needs to be put into the inactive page linked list first, and then the subsequent page recovery flow is executed based on the page management method of the inactive page linked list.
To sum up, in the present exemplary embodiment, a page to be managed is obtained from a page linked list; if the page to be managed is determined to be the non-recyclable page, inserting the page to be managed into a non-recyclable page linked list; and carrying out page recycling management based on the unrecyclable page linked list. On one hand, the exemplary embodiment provides a new page management method, by setting an unrecoverable page linked list, when determining that a page to be managed is an unrecoverable page, the page to be managed is inserted into the unrecoverable page linked list for page recovery management, so that the problems that in the prior art, the page recovery period is long and the system performance is affected due to the fact that the unrecoverable page is placed in the page linked list again for recovery are avoided; on the other hand, the page recovery management is carried out based on the unrecyclable page linked list, so that a memory page closer to the least recently used memory can be selected during page recovery, the logic of page recovery is optimized, and the page recovery process is more accurate and effective.
Exemplary embodiments of the present disclosure also provide a page management apparatus. As shown in fig. 8, the page management apparatus 800 may include: the page obtaining module 810 is configured to obtain a page to be managed from a page linked list; the page inserting module 820 is configured to insert the page to be managed into the unrecyclable page linked list if it is determined that the page to be managed is the unrecyclable page; and the page management module 830 is configured to perform page recycling management based on the unrecyclable page linked list.
In an exemplary embodiment, the page linked list includes an active page linked list or an inactive page linked list.
In an exemplary embodiment, when the page linked list is an active page linked list, the page inserting module includes: the first page inserting unit is used for inserting the page to be managed into the unrecoverable active page linked list if the page to be managed is determined to be the unrecoverable page; the page management apparatus further includes: and the second page inserting unit is used for inserting the page to be managed into the inactive page linked list if the page to be managed is determined to be a recyclable page.
In an exemplary embodiment, when the page linked list is an inactive page linked list, the page inserting module includes: the third page inserting unit is used for inserting the page to be managed into the unrecoverable inactive page linked list if the page to be managed is determined to be the unrecoverable page; the page management apparatus further includes: and the fourth page inserting unit is used for performing page recycling on the page to be managed if the page to be managed is determined to be a recyclable page.
In an exemplary embodiment, the page insertion module includes: the fifth page inserting unit is used for inserting the page to be managed into the unrecyclable page linked list of the anonymous page if the page to be managed is determined to be the anonymous page; and the sixth page inserting unit is used for inserting the page to be managed into the unrecyclable page linked list of the file page if the page to be managed is determined to be the file page.
In an exemplary embodiment, the page management module includes: and the condition judging unit is used for recovering the page from the head or the tail of the unrecoverable page linked list when the preset recovery condition is met.
In an exemplary embodiment, the preset recovery condition includes any one of: the current time for recovering the page exceeds a first threshold value from the insertion time of the page to be recovered in the unrecyclable page linked list; when the current page recovery is carried out, the distance between the page to be recovered and the page to be recovered is inserted into the unrecyclable page linked list, and the number of turns for carrying out the page recovery in the middle exceeds a second threshold value; the number of the pages in the current unrecyclable page linked list reaches a third threshold value; the memory occupancy in the system reaches a fourth threshold.
The specific details of each module in the above apparatus have been described in detail in the method section, and details that are not disclosed may refer to the method section, and thus are not described again.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
Exemplary embodiments of the present disclosure also provide a program product for implementing the above method, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the following claims.

Claims (10)

1. A page management method, comprising:
acquiring a page to be managed from a page linked list;
if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable page linked list;
and carrying out page recycling management based on the unrecyclable page linked list.
2. The method of claim 1, wherein the page linked list comprises an active page linked list or an inactive page linked list.
3. The method according to claim 2, wherein when the page chain table is the active page chain table, the inserting the page to be managed into a non-recyclable page chain table if it is determined that the page to be managed is a non-recyclable page comprises:
if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable active page linked list;
the method further comprises the following steps:
and if the page to be managed is determined to be a recyclable page, inserting the page to be managed into an inactive page linked list.
4. The method according to claim 2, wherein when the page chain table is the inactive page chain table, the inserting the page to be managed into the non-recoverable page chain table if it is determined that the page to be managed is a non-recoverable page comprises:
if the page to be managed is determined to be an unrecoverable page, inserting the page to be managed into an unrecoverable inactive page linked list;
the method further comprises the following steps:
and if the page to be managed is determined to be a recyclable page, page recycling is carried out on the page to be managed.
5. The method according to claim 1, wherein the inserting the page to be managed into the linked list of non-recyclable pages comprises:
if the page to be managed is determined to be an anonymous page, inserting the page to be managed into an unrecoverable page linked list of the anonymous page;
and if the page to be managed is determined to be a file page, inserting the page to be managed into an unrecoverable page linked list of the file page.
6. The method of claim 1, wherein performing page eviction management based on the non-evictable page linked list comprises:
and when the preset recovery condition is met, recovering the page from the head or the tail of the unrecyclable page linked list.
7. The method of claim 6, wherein the preset recovery condition comprises any one of:
the current time for recovering the page exceeds a first threshold value from the insertion time of the page to be recovered in the unrecyclable page linked list;
when the current page recovery is carried out, the distance between the page to be recovered and the page to be recovered is inserted into the unrecyclable page linked list, and the number of turns for carrying out the page recovery in the middle exceeds a second threshold value;
the number of the pages in the current unrecyclable page linked list reaches a third threshold value;
the memory occupancy in the system reaches a fourth threshold.
8. A page management apparatus, comprising:
the page acquisition module is used for acquiring a page to be managed from a page linked list;
the page inserting module is used for inserting the page to be managed into the unrecyclable page linked list if the page to be managed is determined to be the unrecyclable page;
and the page management module is used for carrying out page recycling management based on the unrecyclable page linked list.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1 to 7 via execution of the executable instructions.
CN202011253365.7A 2020-11-11 2020-11-11 Page management method, page management device, storage medium and electronic equipment Pending CN112256997A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011253365.7A CN112256997A (en) 2020-11-11 2020-11-11 Page management method, page management device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011253365.7A CN112256997A (en) 2020-11-11 2020-11-11 Page management method, page management device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112256997A true CN112256997A (en) 2021-01-22

Family

ID=74265274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011253365.7A Pending CN112256997A (en) 2020-11-11 2020-11-11 Page management method, page management device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112256997A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010228A (en) * 2021-03-19 2021-06-22 Oppo广东移动通信有限公司 Memory processing method and device, electronic equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502579A (en) * 2016-09-22 2017-03-15 广州华多网络科技有限公司 Method for reconstructing and device when a kind of data storage fails
CN111782559A (en) * 2020-07-06 2020-10-16 Oppo广东移动通信有限公司 Page management method and device and computer readable storage medium
CN111858393A (en) * 2020-07-13 2020-10-30 Oppo(重庆)智能科技有限公司 Memory page management method, memory page management device, medium and electronic device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502579A (en) * 2016-09-22 2017-03-15 广州华多网络科技有限公司 Method for reconstructing and device when a kind of data storage fails
CN111782559A (en) * 2020-07-06 2020-10-16 Oppo广东移动通信有限公司 Page management method and device and computer readable storage medium
CN111858393A (en) * 2020-07-13 2020-10-30 Oppo(重庆)智能科技有限公司 Memory page management method, memory page management device, medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113010228A (en) * 2021-03-19 2021-06-22 Oppo广东移动通信有限公司 Memory processing method and device, electronic equipment and computer readable storage medium
CN113010228B (en) * 2021-03-19 2024-08-27 Oppo广东移动通信有限公司 Memory processing method, memory processing device, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109857555B (en) Memory recovery method and device, storage medium and electronic equipment
CN109857556B (en) Memory recovery method and device, storage medium and electronic equipment
US20190220418A1 (en) Memory Management Method and Apparatus
CN103136116B (en) Storage system and control device, management method and power interruption recovering method
US8024546B2 (en) Opportunistic page largification
CN103123604A (en) Method for tracking memory usages of a data processing system
CN111258921A (en) Method and device for recycling garbage memory, electronic equipment and storage medium
CN110543435B (en) Mixed mapping operation method, device and equipment of storage unit and storage medium
CN115495025B (en) Method and device for managing abnormal memory block
CN114996173B (en) Method and device for managing write operation of storage equipment
US11204869B2 (en) System and method for facilitating data storage with low-latency input/output and persistent data
CN111858393B (en) Memory page management method, memory page management device, medium and electronic equipment
CN109947589B (en) Approximate data storage method in flash memory
CN112256997A (en) Page management method, page management device, storage medium and electronic equipment
CN109478163B (en) System and method for identifying a pending memory access request at a cache entry
CN114781322B (en) Memory state recovery method for MMU-free environment in CPU chip simulation acceleration
CN103714059A (en) Data updating method and device
CN113377296B (en) Storage management method and system for NAND Flash of vehicle-mounted terminal, vehicle-mounted terminal and vehicle
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
CN109739776B (en) Greedy garbage collection system for NAND Flash main control chip
CN113760781A (en) Data processing method and device, electronic equipment and storage medium
CN112463374A (en) Memory management method, device, equipment and storage medium
CN112783656A (en) Memory management method, medium, device and computing equipment
CN112817769A (en) Game resource dynamic caching method and device, storage medium and electronic equipment
CN111897748B (en) Mapping relation storage method, reading method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20241008