CN115858047A - Method for preloading file pages, electronic equipment and chip system - Google Patents
Method for preloading file pages, electronic equipment and chip system Download PDFInfo
- Publication number
- CN115858047A CN115858047A CN202310174856.XA CN202310174856A CN115858047A CN 115858047 A CN115858047 A CN 115858047A CN 202310174856 A CN202310174856 A CN 202310174856A CN 115858047 A CN115858047 A CN 115858047A
- Authority
- CN
- China
- Prior art keywords
- application
- pte
- page
- snapshot
- kernel
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The application provides a method for preloading file pages, electronic equipment and a chip system, which relate to the technical field of terminal application, wherein after application cold start is finished, a page object accessed in the application cold start process is taken as a PTE (PTE snapshot) of a file page to generate a PTE snapshot (the PTE snapshot contains a file name of file data in the file page, an offset address in a disk and the like), and the PTE snapshot can be stored in the disk; when the application is cold started next time, reading the PTE snapshot of the application from the disk in advance, and loading the file data in the physical memory according to the PTE snapshot; subsequently, after the process of the application is started, a mapping relation between the virtual address and the physical address can be established based on the physical address of the file data in the physical memory, and the PTE is filled; because the PTE is filled, the condition of page missing abnormity in the application starting process can be reduced, and the application starting speed is accelerated.
Description
Technical Field
The embodiment of the application relates to the technical field of terminal application, in particular to a method for preloading file pages, electronic equipment and a chip system.
Background
As electronic devices become more and more powerful, more and more applications are installed in the electronic devices, and users can use the functions provided by the applications based on the applications installed in the electronic devices.
When a cold start is applied, a page fault exception typically occurs due to the lazy allocation mechanism. After the page fault exception occurs, the system puts the application process in the starting process into a blocking queue until the problem of the page fault exception is solved. For example, after a Page fault exception occurs, a physical memory is allocated for the application, relevant file data is loaded in the allocated physical memory, and a Page Table Entry (PTE) for storing a mapping relationship between a virtual memory and the physical memory is filled with the mapping relationship between the virtual memory and the allocated physical memory of the application, which may result in a long time for cold start of the application and poor user experience.
Disclosure of Invention
The embodiment of the application provides a method for preloading file pages, electronic equipment and a chip system, which can accelerate the cold start of applications and improve user experience.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for preloading file pages, including:
the kernel receives pre-reading information, wherein the pre-reading information comprises an identifier of the first application and a cold start identifier;
responding to the pre-reading information, the kernel reads a PTE snapshot corresponding to the identification of the first application from the disk, and the PTE snapshot is generated for PTE of a file page based on a page object accessed in the history cold starting process of the first application;
and loading file data corresponding to the PTE snapshot in the disk into a physical memory by the kernel.
In the method, a page object accessed in the application cold start process is a PTE (packet interconnect) of a file page to generate a PTE snapshot, and the PTE snapshot is stored in a disk; and reading the PTE snapshot corresponding to the identifier of the same application from the disk when the application is subjected to subsequent cold start. Then loading the file data corresponding to the PTE snapshot in the disk to a physical memory; the process of loading the file data in the disk in the physical memory in the application starting process can be saved, and the application cold starting speed is accelerated; in addition, when the application is in a certain cold start stage, the application can fill the PTE according to the physical address of the file data loaded in the physical memory, thereby reducing the page fault abnormal phenomenon in the cold start process of the application and accelerating the cold start speed of the application.
As another implementation manner of the first aspect of the present application, before the kernel receives the read-ahead information, the method further includes:
the kernel receives capture information, wherein the capture information comprises an identifier of the first application and a cold start identifier;
responding to the capture information, the kernel generates a PTE snapshot corresponding to the identifier of the first application according to the PTE of the file page of the page object in the page table corresponding to the identifier of the first application;
and the kernel stores the PTE snapshot corresponding to the identification of the first application in a disk.
In the application, file data read by the same application in the cold start process is the same, so that a page object in a page table corresponding to the application in the historical cold start process can be used as a PTE of a file page to generate a PTE snapshot of the application, and the file page can be preloaded according to the PTE snapshot during subsequent cold start.
As another implementation manner of the first aspect of the present application, in response to the capture information, the kernel generates, according to a PTE, where a page object in a page table corresponding to the identifier of the first application is a file page, a PTE snapshot corresponding to the identifier of the first application, including:
in response to the capture information, the kernel determines that a PTE snapshot corresponding to the identifier of the first application does not exist in the disk;
and the kernel generates a PTE snapshot corresponding to the identifier of the first application according to the PTE of the file page of the page object in the page table corresponding to the identifier of the first application.
In the method and the device, the PTE snapshot does not need to be generated according to the PTE accessed in the cold starting process after each cold starting of the application. Because the file data required by the same application during each cold start is the same, under the condition that a disk does not have a PTE snapshot corresponding to the application, a PTE snapshot corresponding to the application needs to be generated according to a PTE of which a page object in a page table corresponding to the application is a file page; and under the condition that the disk already has the PTE snapshot corresponding to the application, generating the PTE snapshot corresponding to the application according to the PTE of which the page object in the page table corresponding to the application is the file page.
As another implementation manner of the first aspect of the present application, the generating, by the kernel, a PTE snapshot corresponding to the identifier of the first application according to the PTE, where the page object in the page table corresponding to the identifier of the first application is a file page, includes:
and the kernel takes the state bit in the page table corresponding to the identifier of the first application as a preset character, the page object is a PTE (packet interconnect) of the file page, and generates a PTE snapshot corresponding to the identifier of the first application, wherein the preset character is used for indicating that a virtual memory corresponding to the PTE is mapped to a physical memory.
In the application, the PTE generating the PTE snapshot may be determined according to the status bit in the data structure of the PTE and the page object (i.e., page flag).
As another implementation manner of the first aspect of the present application, before the kernel receives the read-ahead information, the method further includes:
the monitoring module monitors that a first application is started to a pre-reading node, and the pre-reading node is positioned before an ApplicationStart stage in the application starting process;
the monitoring module sends a pre-reading instruction to the pre-reading module;
and responding to the pre-reading instruction, and transmitting pre-reading information to the kernel through system call by the pre-reading module.
In the application, the process of pre-reading the file pages is realized through the kernel of the kernel space; detecting a pre-read time node through a monitoring module of a user space; the information interaction of the user space and the kernel space is realized in a system calling mode; to increase the speed of application startup, a time node to be read ahead may be determined before the ApplicationStart phase where a large number of page fault exceptions occur.
As another implementation manner of the first aspect of the present application, before the kernel receives the capture information, the method further includes:
the monitoring module monitors that a first application is started to a capture node, and the capture node is positioned at the end of or within the first time after the DoFrame stage in the application starting process;
the monitoring module sends a capture instruction to the pre-reading module;
in response to the capture instruction, the read-ahead module transmits capture information to the kernel via a system call.
In the application, the process of generating the PTE snapshot is realized through a kernel of a kernel space; detecting a time node for generating a PTE snapshot through a monitoring module of a user space; the information interaction between the user space and the kernel space is realized in a system calling mode; in order to generate a file page filled with all missing pages in the application cold start process, the file page can be determined as a time node for capturing PTE information within the first time after or at the end of the DoFrame phase in the application cold start process.
As another implementation manner of the first aspect of the present application, before the kernel receives the capture information, the method further includes:
the monitoring module monitors that a first application is started to a capture node, and the capture node is positioned at the end of an activityStart stage in the application starting process or within a first time after the end of the activityStart stage;
the monitoring module sends a capture instruction to the pre-reading module;
in response to the capture instruction, the read-ahead module transmits capture information to the kernel through a system call.
In the application, the PTE information may also be captured at the end of or within the first time after the ActivityStart phase in which a large amount of missing page anomalies occur during the application startup process according to the actual situation, where the captured PTE information already contains most of the file data required during the application cold start process.
As another implementation of the first aspect of the present application, the method further includes:
the kernel receives deletion information, wherein the deletion information comprises an identifier of the first application;
and in response to the deletion information, the kernel deletes the PTE snapshot corresponding to the identification of the first application stored in the disk.
In the present application, in order to save a disk space, when an application is deleted from an electronic device, the PTE snapshot of the application may be deleted together.
As another implementation manner of the first aspect of the present application, before the kernel receives the deletion information, the method further includes:
the monitoring module receives an unloading instruction of a first application;
in response to the uninstall instruction, the monitoring module transmits delete information to the kernel through a system call.
As another implementation manner of the first aspect of the present application, the PTE includes a mapping relationship between the virtual memory and the physical memory, and the PTE snapshot includes a file name of file data stored in a physical address corresponding to the PTE and a storage address of the file data in the disk.
In a second aspect, an electronic device is provided, comprising a processor for executing a computer program stored in a memory, implementing the method of any of the first aspect of the present application.
In a third aspect, a chip system is provided, which includes a processor coupled to a memory, and the processor executes a computer program stored in the memory to implement the method of any one of the first aspect of the present application.
In a fourth aspect, there is provided a computer readable storage medium storing a computer program which, when executed by one or more processors, performs the method of any one of the first aspects of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, which when run on an apparatus, causes the apparatus to perform the method of any one of the first aspect of the present application.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
Fig. 1 is a schematic hardware structure diagram of an electronic device to which a method for preloading memory pages is applied according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating a data flow from a virtual address to a physical address according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a page fault exception phenomenon during a cold start according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an abnormal page fault phenomenon during a warm boot process according to an embodiment of the present disclosure;
fig. 5 is a data structure relationship diagram of a virtual space describing a process according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a data structure of a PTE provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a time node for capturing a PTE snapshot and a pre-read PTE snapshot when an application is cold started according to an embodiment of the present application;
fig. 8 is a schematic diagram of a time node for capturing a PTE snapshot and a pre-read PTE snapshot when an application is started hot according to an embodiment of the present application;
FIG. 9 is a block diagram illustrating a technical architecture of a method for preloading memory pages according to an embodiment of the present disclosure;
FIG. 10 is a timing diagram illustrating a PTE snapshot captured during a cold start of an application according to an embodiment of the present application;
FIG. 11 is a timing diagram illustrating pre-reading PTE snapshots during cold start of an application according to an embodiment of the present application;
fig. 12 is a schematic flowchart illustrating kernel execution during cold boot of an application according to an embodiment of the present application;
fig. 13 is a schematic flowchart illustrating kernel execution when an application is uninstalled according to an embodiment of the present application;
fig. 14 is a schematic flowchart illustrating kernel execution during application warm boot according to an embodiment of the present application;
fig. 15 is a schematic diagram comparing the time delay and IOwait of the application start method and the native flow provided in the embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and/or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, a and/or B, may represent: a exists singly, A and B exist simultaneously, and B exists singly, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," "fourth," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The method for preloading the memory pages can be applied to electronic equipment. The electronic device may be a tablet computer, a mobile phone, a wearable device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), or other electronic devices. The embodiment of the present application does not limit the specific type of the electronic device.
Fig. 1 shows a schematic structural diagram of an electronic device. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a touch sensor 180K, an ambient light sensor 180L, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, and an application program (such as a sound playing function, an image playing function, etc.) required by at least one function.
In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio signals into analog audio signals for output, and also used to convert analog audio inputs into digital audio signals. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into a sound signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking near the microphone 170C through the mouth. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to implement noise reduction functions in addition to listening to voice information. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on. For example, the microphone 170C may be used to collect voice information related to embodiments of the present application.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association) standard interface of the USA.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a variety of types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration prompts as well as for touch vibration feedback.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV and other formats. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The embodiment of the present application does not particularly limit a specific structure of an execution main body of a method for preloading a memory page, as long as communication can be performed according to the method for preloading a memory page provided in the embodiment of the present application by running a code recorded with the method for preloading a memory page of the embodiment of the present application. For example, an execution subject of the method for preloading the memory pages provided in the embodiments of the present application may be a functional module in the electronic device, which is capable of calling the program and executing the program, or a communication device, such as a chip, applied to the electronic device.
In paged memory management, the operating system may allocate virtual memory to processes, for example, in a 32-bit operating system, the maximum space of virtual memory allocated to each process is 4GB. The virtual memory may be divided into fixed-size pages, each Page being a Page, for example, the virtual memory may be divided into 4KB (8 KB, 16KB, etc.) size pages. Meanwhile, the kernel can divide the physical memory of the electronic device into pages of the same size, and the pages in the physical memory can be recorded as physical pages. Thus, a page is the smallest allocation unit, whether it is virtual memory or physical memory.
Data (for example, a code segment, a data segment, a stack segment, and the like) corresponding to the user program is stored in the physical memory, and the user program cannot directly access or view the physical memory, but the user program can directly access or view the virtual memory, so that a mapping relationship needs to be established between the virtual memory and the physical memory.
As described above, the smallest allocation unit in the virtual memory and the physical memory is a page, where a page in each virtual memory has a virtual address and a page in each physical memory has a physical address; therefore, the mapping relationship is a mapping relationship between a virtual address in the virtual memory and a physical address in the physical memory.
Referring to fig. 2, a flow diagram from a virtual address to a physical address is provided according to an embodiment of the present application. When a Central Processing Unit (CPU) needs to access data and obtain an instruction, the CPU sends a virtual address corresponding to the data or the instruction to a Memory Management Unit (MMU), and the memory management unit is responsible for searching for a physical address corresponding to the virtual address according to the mapping relationship. And the memory management unit sends the searched physical address to the physical memory, and the physical memory reads or writes related data or instructions after performing corresponding access according to the physical address.
The memory management unit stores a page table for each user program, the page table stores a mapping relationship from a virtual page (the virtual page corresponds to a virtual address) to a physical page (the physical page corresponds to a physical address), and when a physical page is allocated to a virtual page, a record is added in the page table to store the mapping relationship between the virtual page and the physical page. Subsequently, the received virtual address may be converted into a physical address based on the mapping relationship between the virtual page and the physical page stored in the page table.
Of course, after the memory management unit receives a virtual address, it needs to first determine whether the virtual address is valid, in the physical memory, or protected.
If the virtual address is valid, and if the corresponding physical address exists in the physical memory and is not protected (i.e., accessible), the physical address corresponding to the virtual address can be found in the page table by using the virtual address as an index.
However, there may also be situations where a page fault exception is triggered as follows: the virtual address is valid, but there is no physical address in physical memory that corresponds to the virtual address.
This may be due to an inert allocation mechanism, that is, when a user program is started, a virtual memory is allocated to the user program, however, at this time, a physical memory is not allocated, a mapping relationship between the virtual memory and the physical memory does not exist naturally, and when the user program needs to access certain data during running, a physical address corresponding to the virtual address is searched in the physical memory according to the virtual address corresponding to the data. The missing page abnormality occurs more frequently in the cold starting process of the application.
This may also be the case because the accessed data is swapped out of the physical memory, for example, after the user program switches to the background running, because the physical memory resources are limited, the operating system may initiate a memory page swap to place a physical page (e.g., an anonymous page) that is not used for a long time into the swap partition to give the vacated physical memory resources to other user programs for use, and if the data accessed by the user program is located in the swap partition, a case where a physical address corresponding to the virtual address cannot be found in the physical memory may occur, and a page fault exception may be triggered. The operating system may also recycle a physical page (e.g., a file page) that is not used for a long time to give the vacated physical memory resource to other user programs for use, and if data accessed by the user program has been recycled from the physical memory to the disk, a situation that a physical address corresponding to the virtual address cannot be found in the physical memory may also occur, which may trigger a page fault exception. Such page fault exception occurs more frequently during application warm start.
No matter which kind of page fault is abnormal, data may be read from a disk or a swap partition to a physical memory, a mapping relation between a virtual address and a physical address is established, a PTE is filled, a user program can continue to run, and the running of the user program is seriously blocked under the condition.
Of course, in practical application, there may be other abnormal situations, and the embodiment of the present application is not focused on the cause of the page fault abnormality, and therefore is not listed one by one.
After the page fault exception occurs, the operating system puts the user program into the blocking queue, and the user program is not put into the ready queue until the page fault exception problem is solved, and the user program continues to run. Therefore, after the page fault exception occurs, the running of the user program may be blocked.
In the starting process of the application program, the above-mentioned page fault exception condition may occur more often, resulting in a slower starting process of the application and a poorer user experience.
The application starting mode can comprise cold starting and hot starting, and when the application is started, if the application process does not exist in the system, the system needs to establish a process for the application, which indicates that the application is started in the cold starting mode.
As an example of application cold start, after the electronic device is started, a user clicks an application icon on a system desktop to start an application, and the start process of the application is cold start.
As another example of the application cold start, after the user starts the application, the user switches the application to the background running, and the system reclaims the resources, and kills the process of the application. When the user starts the application again, the starting process of the application is cold starting.
Referring to fig. 3, a schematic diagram of a page fault exception in an application cold start process according to an embodiment of the present application is provided. In this illustration, the horizontal axis represents the various phases in the application cold start process, wherein several phases are highlighted: application Start, bindapplication, activityStart, choreograph, and DoFrame. These phases are described in detail with reference to the subsequent embodiments. The black vertical bar indicates that the missing page abnormality has occurred, and the thicker the black vertical bar, the greater the number of times the missing page abnormality has occurred in a short time. As can be understood from fig. 3, in the application cold start process, in the BindApplication stage, a large number of missing page anomalies occur, and in the ActivityStart stage, a small number of missing page anomalies also occur, and these missing page anomalies may cause the application cold start process to be slow.
When the application is started, if the process of the application already exists in the system, the system does not need to create the process for the application, but starts to create Activity and subsequent operations by using the process originally existing in the system, and the application is started to be in a hot start mode.
As an example of application hot start, after a user starts an application, the user switches the application to a background operation, and the user may switch the application to a foreground operation in various ways. For example, when the application runs in the background, clicking an icon of the application on the system desktop; when the application runs in the background, the application is accessed from a negative screen; when the application runs in the background, the application is started in an applet mode, and the like. Before the application is switched to the foreground for running, the process of the application always exists in the system and is not killed by the system. In this case, the application is switched from the background to the foreground to be started in a warm boot mode.
Fig. 4 is a schematic diagram of a page fault exception in an application warm start process according to an embodiment of the present application. In this illustration, the horizontal axis represents the application warm-start process, wherein several phases are highlighted: activityStart, activityResume, choroegraph, and DoFrame. These phases are described in detail with reference to the subsequent embodiments. The black vertical bar indicates that the missing page abnormality has occurred, and the thicker the black vertical bar, the greater the number of times the missing page abnormality has occurred in a short time. As can be understood from fig. 4, during the application hot start process, many page missing exceptions occur in the activtystart stage, activtyresource stage, chordeograph stage, and DoFrame stage, and these page missing exceptions may cause the application hot start process to be slow.
As can be understood from fig. 3 and fig. 4, during the starting process of the application program, a page missing exception frequently occurs, which results in a slow speed when the application is started and a poor user experience.
The number of page fault exceptions in fig. 3 and 4 is used only for comparison between the respective stages, and does not indicate the absolute number of page fault exceptions occurring at the respective stages.
In order to solve the above problem, an embodiment of the present application provides a method for preloading a memory Page, where after application start is finished, information of a missing Page in an application start process (for example, a file name of file data corresponding to a PTE accessed at this time of start, a storage address in a disk, and the like) may be recorded through a Page Table Entry (PTE) snapshot to generate a PTE snapshot, where the PTE snapshot is stored in the disk; when the application is started subsequently, file data corresponding to the recorded missing page information can be preloaded in the physical memory based on the PTE snapshot stored in the disk.
For cold start, the generated PTE snapshot includes the file name of the file page data corresponding to the PTE accessed during the current start, the storage address in the disk, and the like, so the file page data corresponding to the PTE snapshot is preloaded; the preloading process may be performed before the process is created, after the file data is preloaded in the physical memory, the file data does not need to be loaded from the disk to the physical memory in the subsequent starting process, so that the time from loading the file data from the disk to the physical memory can be saved, and the application cold starting speed is increased.
In addition, in the cold boot process, after the process is started, the system allocates a virtual memory to the process, establishes a mapping relationship between a virtual address and a physical address according to the physical address of the loaded file data in the physical memory, and fills the PTE (for example, fills the mapping relationship between the virtual address and the physical address). After the PTE is filled, the occurrence of page missing abnormity can be reduced, and the speed of application cold start is also improved.
For hot boot, the generated PTE snapshot includes the file name and the storage address of the file data of the file page corresponding to the PTE accessed at this time of boot, and the storage address of the anonymous page data corresponding to the PTE accessed at this time of boot in the swap partition, so the data loaded in the physical memory includes the file data (e.g., the data recycled to the disk) and the anonymous page data (e.g., the data swapped to the swap partition); since the process of the application exists in the system and the virtual space of the process is already allocated, in the hot boot process, after the file data and the anonymous page data are loaded in the physical memory, the mapping relationship between the virtual address and the physical address can be established directly according to the physical addresses of the loaded file data and the anonymous page data in the physical memory, and the PTE is filled (for example, the mapping relationship between the virtual address and the physical address is filled). Therefore, the occurrence of page missing abnormity is reduced, and the application hot start speed is improved.
For a clearer understanding of the method for preloading memory pages provided in the embodiments of the present application, the source of the PTE snapshot is described first.
When an application is cold-started, the system creates a process for the application and also allocates virtual memory (e.g., 4GB in size) for the process. When the application program is started up in a hot mode, the process of the application program in the system is not killed, and the virtual memory of the process also exists.
The virtual space corresponding to a process is depicted by two data structures, one being mm _ struct and the other being vm _ area _ struct.
Referring to fig. 5, each process has only one mm _ struct structure, the mm _ struct structure describes the entire virtual space of one process, and the mm _ struct structure includes a Page Directory pointer (pgd) of the process and a plurality of pointers mmap pointing to the vm _ area _ struct structure.
When the system allocates a virtual space to a process, the virtual space is allocated according to a section, that is, multiple Virtual Memory Areas (VMAs) can be allocated to the process, and each virtual Area corresponds to one vm _ Area _ structure. When n virtual intervals are allocated to a process, n vm _ area _ structs exist, and n pointers mmap which respectively point to different vm _ area _ structs exist in an mm _ struct structure.
Taking vm _ area _ struct corresponding to a section of virtual interval as an example, vm _ start and vm _ end respectively represent the start address and the end address of the area pointed by the virtual interval.
VM _ flags describe the attributes of the virtual interval, which may be VM _ READ (i.e., readable), VM _ WRITE (i.e., writable), VM _ EXEC (i.e., executable), VM _ SHARED (i.e., SHARED by multiple processes).
Other parameters in vm _ area _ struct are not exemplified.
Each segment of virtual interval is composed of a plurality of virtual pages, and the virtual pages in each segment of virtual interval point to physical pages through Page Table Entries (PTEs) in a Page Table (PT).
The Page directory pointer pgd points to a Page Table of the process, the Page Table records a mapping relationship between a virtual Page and a physical Page, the Page Table includes a plurality of Page Table Entries (PTEs), each Page Table Entry points to a Page frame, and a Page frame is a physical Page in real physical memory and can store data in the physical Page.
Taking a virtual memory with a size of 4GB as an example, the virtual memory is divided into virtual pages with a size of 4KB, and then there are 1024 × 1024 virtual pages in the virtual memory, and correspondingly, the page table of the process includes 1024 × 1024 page table entries PTE.
When a process needs to access a virtual address, a vm _ area _ struct where the virtual address is located can be found from a mm _ struct structure, if information recorded in the vm _ area _ struct is that the virtual address has not yet been allocated with a physical address, a page fault exception is triggered, a physical address is allocated to the virtual address, relevant information of the virtual address in the vm _ area _ struct is modified (for example, a physical memory which has not yet been allocated is modified into an allocated physical memory), and a mapping relationship between the virtual address and the physical address is filled into a PTE corresponding to the virtual address. Therefore, the information about all page fault exceptions in the application starting process can be recorded in vm _ area _ struct and PTE.
In the embodiment of the application, the PTE which is filled in the starting process needs to be searched by traversing the PTE so as to generate the PTE snapshot. However, the process of traversal is very time-consuming because the page table of a process contains 1024 × 1024 page table entries PTE.
As described above, when accessing a virtual address, a corresponding PTE may be found from vm _ area _ struct, and similarly, when traversing a PTE, it may also be quickly determined whether to traverse the PTE corresponding to each virtual address from vm _ area _ struct. As an example, a virtual space corresponding to an applied process includes n (e.g., 3, 4, etc.) virtual intervals, each virtual interval corresponds to one vm _ area _ structure, and if no physical memory is mapped in the 1 st virtual interval, the vm _ area _ structure corresponding to the virtual interval does not need to be traversed, and the vm _ area _ structure corresponding to the 2 nd virtual interval is directly skipped to, so that the speed of traversing the PTE can be increased; after jumping to vm _ area _ struct corresponding to the 2 nd virtual interval, according to relevant information (for example, whether the information is valid, whether a physical address exists, whether the information is accessible, and the like) of each virtual address in vm _ area _ struct corresponding to the 2 nd virtual interval, PTEs corresponding to valid, physical addresses and accessible virtual addresses are searched from a page table, and through the method, the PTEs can be quickly traversed.
The PTE can be quickly traversed in the traversal manner as described above, the memory pages filled in the starting process are searched, and then a PTE snapshot is generated according to the searched PTEs (the file name of the file data stored in the physical address corresponding to the PTE, the storage address of the file data in the disk, and the like). When the application is started subsequently, file data originally stored in a disk can be preloaded in a physical memory based on the stored PTE snapshot, so that the process of loading the file data in the physical memory in the application starting process is saved; after the file data is loaded in the physical memory, the PTE can be filled when the process is started to finish the allocation of the virtual space or the process has the allocated virtual space, so that the occurrence of the page missing abnormity can be reduced, and the starting speed of the application is improved.
In the embodiment of the application, a page table with five-level mapping is taken as an example to describe the PTE in the page table.
Referring to fig. 5, the Page table includes a Page Directory pointer (pgd), a Page four level Directory pointer (p 4 d), a Page upper level Directory pointer (pud), a Page middle Directory pointer (pmd), and a Page Table Entry (PTE).
The corresponding pgd for each process is different, and when a new process is created, a new page directory pointer pgd is created for the new process. The pgd comprises a plurality of addresses of p4d, the p4d comprises a plurality of addresses of pud, the pud comprises a plurality of addresses of pmd, and the pmd comprises a plurality of addresses of page table entries PTE. Each page table entry PTE points to a page frame, which is a physical page in the real physical memory.
Referring to fig. 6, it is a structural example of a page table entry PTE.
As an example, the P (also referred to as present) bit indicates whether the virtual page corresponding to the page table entry has been mapped to the physical memory; if the bit is 0, it indicates that mapping has not been established for the virtual page, the data corresponding to the virtual page is swapped out from the physical memory, or the virtual page is no longer used, and when the bit is 0, it indicates that the virtual page corresponding to the page table entry has been mapped into the physical memory.
The R/W bit indicates the read-write attribute of the physical page pointed to by the virtual page corresponding to the page table entry, for example, 0 is read-only, and 1 is readable and writable. The R/W bit in the PTE is set by software, the setting basis is the virtual interval to which the virtual page belongs, namely the VM _ READ/VM _ WRITE attribute set by a section of virtual interval is copied to the PTE of the virtual page contained in the section of virtual interval.
U/S represents the access authority of the physical page pointed by the virtual page corresponding to the page table entry, for example, 0 represents that the virtual page can only be accessed by a kernel.
The specific meanings of the other bits are not explained one by one.
In addition, each PTE corresponds to a pageflag (i.e., a page object), which records whether the physical page represented by the PTE belongs to a file page or an anonymous page (anon), and a specific type of the file page, for example, active, referred.
For an application program, only a part of PTE pages may be used in the application startup process, for example, 1024 × 1024 PTE pages may exist in the 4GB virtual memory, and only a part of PTE pages may be used in the application startup process, so that valid PTE pages (the PTE pages used in the current startup process) need to be screened out. In practical applications, a valid PTE page may be identified from the PTE by the status bit (e.g., the P bit indicates that it has been mapped to physical memory); and then, generating snapshot information according to the effective PTE page, so that the PTE snapshot when the application is started at this time can be obtained. The PTE snapshot can be stored in a disk, and file data corresponding to information in the PTE snapshot is loaded into a physical memory from the disk in advance when the application is started next time, so that the process of loading the file data from the disk to the physical memory in the starting process is saved; and in addition, the PTE is filled in advance under the condition that the PTE can be filled, so that the occurrence of missing page abnormity is reduced, and the application starting speed is improved.
It should be noted that, when an application is in cold boot, in a case that versions of the application are consistent, a read file page is also fixed, so that after the application is in cold boot, a valid PTE (for example, it is determined that the file page is already mapped to a physical memory based on a P bit) corresponding to a file page (for example, it may be determined whether the file page is a file page) in the page missing information in the current cold boot process of the application may be generated to generate a PTE snapshot corresponding to cold boot and store the PTE snapshot in a disk in a file form. Therefore, for cold start, a PTE snapshot may be generated according to a PTE that uses a page object as a file page, and a file page is preloaded during subsequent cold start.
When the method is applied to hot start, due to a memory recovery mechanism, the PTE corresponding to the anonymous page in the missing page information may need to generate a PTE snapshot, in addition, the time of the process of applying the hot start is short, and if all file pages are preloaded, the speed of applying the hot start may be affected, so that PTEs corresponding to part types of file pages can be selected to generate the PTE snapshot according to actual conditions. For example, an active, referred type may be selected.
It should be noted that, in practical application, different status bits may be selected according to actual situations to determine a physical page for generating a PTE snapshot, and PTEs corresponding to different types of file pages may also be selected to generate a PTE snapshot.
Based on the above description, it can be understood that after the start is completed, a PTE snapshot corresponding to the hot start may be generated by using a partial type file page (e.g., active, referred) and an anonymous page in the missing page information in the current hot start process, and stored in a disk in the form of a file, or may also be cached in a memory.
When subsequent cold start is applied, reading a PTE snapshot corresponding to the cold start from a disk; and when the subsequent hot start is applied, reading the PTE snapshot corresponding to the hot start from the disk or the cache.
A specific implementation of the method for preloading memory pages according to the embodiment of the present application will be described below based on the foregoing principles.
Take the starting mode that the user clicks the application icon on the system desktop for the first time after the electronic device is started as an example. The start-up mode is a cold start. The cold start process mainly comprises the following steps:
the system starts loading and launching the application, creating a process for the application, which may be written as ApplicationStart.
The system binds the created process and the application, and the process can be marked as Bindapplication.
The process of the application creates and starts the first Activity, denoted ActivityStart.
The chord graphics object is created to listen to Vsync so that the rendering task can be performed according to the screen refresh frequency, which is denoted as chord graphics.
And processing a drawing task according to the screen refreshing frequency, for example, measuring, laying out and drawing processes of a window corresponding to the first Activity, wherein the drawing stage in the process can be recorded as a DoFrame.
As can be understood from fig. 3, when an application is in a cold start, page missing abnormality mainly occurs in the BindApplication phase, a small number of page missing abnormality occurs in the ActivityStart phase, and after the ActivityStart phase is finished, the phenomenon of page missing abnormality is less likely to occur.
Referring to fig. 7 (a), after the ActivityStart phase ends, traversing the status bit of the PTE and the pageflag pointed by the PTE in the page table to obtain the file pages used when the application is cold-started, and generating the PTE snapshot according to the used file pages.
As another embodiment of the present application, referring to (b) in fig. 7, after the ActivityStart phase ends, a page missing exception does not completely occur, but occurs less frequently, so to reduce the probability of a page missing exception during subsequent cold boot of an application, when the DoFrame phase ends (an interface of a first Activity will be displayed after the DoFrame phase ends) or within a certain time period after the DoFrame phase ends, a file page used during the cold boot of the application may be obtained by traversing the state bits of the PTEs and the pageflag pointed by the PTEs in the page table, and a PTE snapshot may be generated according to the file names of file data stored in the file pages used, the storage addresses of the disks, and the like.
Reasons why the PTE snapshot may be used in subsequent cold starts include: during the cold start, reading file data from a disk to a physical memory, and filling a physical address of the file data in the PTE; in order to read file data from the disk to the physical memory in advance when the disk is cold started next time, the file name of the file data in the physical page corresponding to the physical address in the currently filled PTE and the storage address of the file data in the disk may be generated into a PTE snapshot. Therefore, during subsequent cold start, the storage address of the file data used in the application cold start process in the disk can be obtained according to the PTE snapshot, the part of the file data can be read from the disk into the physical memory, after the application process is started and the virtual space is allocated, the mapping relation between the physical address and the virtual address of the part of the file data in the physical memory can be established, and the PTE is continuously filled, so that the occurrence of page fault exception can be reduced.
As another embodiment of the present application, in practical application, at any time point from the end of the ActivityStart phase to the middle of the end of the DoFrame phase, the status bit of the PTE and the pageflag pointed by the PTE in the page table are traversed to obtain the file pages used when the application is cold-started, and the PTE snapshot is generated according to the file pages used.
The PTE snapshot generated at any point in time, whether listed above, may be stored in a disk of the electronic device for use by the application upon subsequent cold starts. Of course, the time for storing the generated PTE snapshot on the disk of the electronic device may be later, and the storage may be successful at the next cold start. As an example, the application may be stored immediately after being generated, or may be stored when the application switches to a background run or ends a run.
Referring to fig. 7 (c), in the subsequent cold start process of an application, because the page fault exception mainly occurs at the bind application stage and after, it is necessary to read the PTE snapshot stored during the historical cold start of the application from the disk of the electronic device before the bind application stage, and then load the file data required by the process of the application in the physical memory according to the information recorded in the PTE snapshot, thereby saving the process of loading the file data in the start process. Subsequently, after the BindApplication (after the BindApplication, the process is completely started and virtual space is allocated), the PTE information can be filled, the probability of page missing abnormality in the subsequent starting process is reduced, and the application starting speed is increased.
As another embodiment of the application, after the electronic device receives a click operation of an icon of the application on a system desktop and before a BindApplication stage starts, the PTE snapshot stored during the historical cold start of the application may be read from a disk of the electronic device, and then file data required by a process of the application is loaded in a physical memory according to information recorded in the PTE snapshot, so that a process of loading the file data during a start process is saved. Subsequently, PTE information can be filled after the Bindapplication, so that the probability of subsequent page missing abnormity is reduced, and the application starting speed is increased.
The hot start of the application means that the process of the application is not destroyed after the application is returned to the background, so that in the hot start, starting from ActivityStart, the process of the hot start of the application mainly includes:
the application process creates and starts Activity that last exited to the foreground, which is denoted as ActivityStart.
Activity last returned to background enters resume state, which is denoted ActivinyResume.
The chord graphics object is created to listen to Vsync so that the rendering task can be performed according to the screen refresh frequency, which is denoted as chord graphics.
And processing a drawing task according to the screen refreshing frequency, for example, measuring, laying out and drawing processes of a window corresponding to the first Activity, wherein the drawing stage in the process can be recorded as a DoFrame.
As can be understood from fig. 4, when the application is in a warm start, page fault exceptions mainly occur in the ActivityStart phase, activityresponse phase, and the chord phase.
Referring to fig. 8 (a), when or after the DoFrame stage is finished, traversing the PTE in the page table, obtaining a part of file pages used when the application is hot-started (for example, file pages of Active type and referred type are determined and selected according to the pageflag corresponding to the PTE) and anonymous pages (for example, file pages of anon type is determined and selected according to the pageflag corresponding to the PTE) according to the status bit and the pageflag pointed by the PTE, and generating a PTE snapshot according to the used file pages and the anonymous pages.
In practical application, the duration of hot start is short, and if all information of page fault abnormality in the hot start process is still obtained, the process of reading and preloading a PTE snapshot from a disk or a memory during subsequent hot start becomes longer, which undoubtedly prolongs the duration of hot start.
Most important information of the missing page abnormality in the hot start process is in the ActivityStart stage, referring to (b) in fig. 8, when the ActivityStart stage is ended or within a short time after the ActivityStart stage, a status bit of a PTE and a pageflag pointed by the PTE in a page table can be traversed to obtain a part of file pages (for example, file pages of an active type and a recommended type are determined and selected according to the pageflag corresponding to the PTE) and anonymous pages (for example, file pages of an anon type is determined and selected according to the pageflag corresponding to the PTE) used in the hot start of the application, and a PTE snapshot is generated according to the used file pages and the anonymous pages.
As another embodiment of the present application, at any time point after the ActivityStart phase to the middle of the DoFrame phase end time, the status bit of the PTE and the pageflag pointed by the PTE in the page table may be traversed to obtain a part of file pages used when the application is hot-started (for example, file pages of an active type and a recommended type are determined and selected according to the pageflag corresponding to the PTE) and an anonymous page (for example, file pages of an anon type is determined and selected according to the pageflag corresponding to the PTE), and a PTE snapshot may be generated according to information of the used file pages and the anonymous page (for example, information of a file name of file data stored in the file page, a storage address of a disk, and the like, and a storage address of the data stored in the anonymous page in the swap partition).
The PTE snapshot generated at any point in time, whether listed above, may be stored in memory or on disk of the electronic device for use by the application at a subsequent warm boot.
Referring to (c) in fig. 8, in the subsequent warm boot process of an application, since page fault abnormalities occur in a large amount already at the ActivityStart phase, it is necessary to read PTE snapshots stored during the historical warm boot of the application from a memory or a disk of an electronic device before the ActivityStart phase, and then load file data and anonymous page data required by a process of the application according to information recorded in the PTE snapshots.
As another embodiment of the present application, after the electronic device detects that the application is hot-started, the PTE snapshot stored during the historical hot-start of the application may be read from the memory or the disk of the electronic device, and then the file data and the anonymous page data required by the process of the application may be loaded according to the information recorded in the PTE snapshot, so that PTE information may be pre-populated, the probability of page fault abnormality is reduced, and the application starting speed is increased.
In order to more clearly understand the method for preloading the memory page provided in the embodiment of the present application, a process of acquiring and storing a PTE snapshot and a process of preloading a PTE snapshot will be described in detail below.
Linux divides the virtual address space into two parts: user space and kernel space. User space does not have direct access to kernel space, and system calls need to be used when a user process must access the kernel or use kernel functions.
The kernel space provides a function entry of the system call; in order to enable the user space to use the entries of these system calls, these system calls can be encapsulated in the user space, resulting in an encapsulated interface that can be used directly by processes in the user space.
When the process of the user space needs a system call to access some resources on the hardware device or the operating system, the process of the user space uses the system call through the packaging interface, and the system call realizes the access of the hardware device or the system resources in the kernel through the kernel function. I.e., the system call may act as an information interactor in user space and kernel space.
Referring to the system architecture diagram shown in fig. 9, there are a plurality of applications, for example, application a and application B, at the application layer.
A monitoring module, a pre-reading module and a capturing module exist in an application framework layer, wherein the pre-reading module and the capturing module can be used as one module or two independent modules.
The monitoring module may be a separately configured module for monitoring the application start-up process, or may be some services that may monitor the application start-up process in the system itself, or the like. After monitoring that the application is started to a certain time node (for example, a time node requiring pre-reading), the monitoring module may send a pre-reading instruction to the pre-reading module. The monitoring module may send a capture instruction to the capture module after monitoring that the application is started up to a certain time node (e.g., after the DoFrame phase).
After receiving the pre-reading instruction (or the capturing instruction received by the capturing module), the pre-reading module may perform system call, so as to transmit the unique identifier and the starting mode of the application currently being started to the called kernel function.
The kernel layer has a kernel function, and the kernel function is used to implement different functions, for example, a read-ahead function provided in the embodiment of the present application, and a function of traversing the PTE to generate the PTE snapshot provided in the embodiment of the present application.
The hardware layer has a disk and a physical memory. The disk is used for storing PTE snapshots generated during cold start and file data required in the application starting process; when the kernel is started subsequently, the kernel firstly reads the PTE snapshot from the disk, and then file data corresponding to information recorded by the PTE snapshot is preloaded into the physical memory from the disk. The PTE snapshot generated during the warm boot can be stored in a disk or a physical memory according to actual needs.
For a clearer understanding of the interaction between the various modules, reference is made to the timing diagram of the process of generating and storing PTE snapshots at application cold start shown in fig. 10. The monitoring module and the capturing module are positioned in a user space, and the kernel is positioned in a kernel space.
S101, the monitoring module monitors that the application runs to a capture node when the application is started.
In this embodiment of the application, if the application of the current start process is cold start, the capture node is any one of nodes shown in (a) in fig. 7 to (b) in fig. 7, which are set in advance.
S102, the monitoring module sends a capture instruction to the capture module after monitoring that the application runs to the capture node when being started.
S103, the capture module carries out system call and transmits the unique identification of the application which is currently started and the starting mode identification to the called kernel function.
In the embodiment of the application, each application has a unique identifier for distinguishing different applications, so that the unique identifier of the application is associated when the PTE snapshot corresponding to the application is stored so as to be distinguished from PTE snapshots of other applications; the starting mode is used for determining whether the generated PTE snapshot at the hot starting time or the PTE snapshot at the cold starting time.
In the embodiment of the application, the starting mode identifier indicates that the starting is cold starting.
S104, the kernel traverses the PTE to obtain the information of the effective file page in the starting process.
If the starting mode identifier indicates that the starting is cold starting, the file names and the storage addresses in the disk space of all effective file pages (for example, the effective file pages are that the PTE status bit indicates that the PTE status bit is mapped to the physical address, and the pageflag is the file page) are obtained.
And S105, generating a PTE snapshot by the kernel according to the information of the traversed effective file page. Of course, the PTE snapshot may also include other information of the file data, which is not limited in this embodiment of the application.
S106, the kernel stores the cold-started PTE snapshot corresponding to the application identification in a disk.
By the method, the information of all effective file pages in the cold start process of the application can be obtained for use in the subsequent cold start of the application.
Refer to fig. 11 for a timing diagram illustrating a process of preloading PTE snapshots at application cold start. The monitoring module and the pre-reading module are positioned in a user space, and the kernel is positioned in a kernel space.
And S111, the monitoring module monitors that the application starts and then the application starts to go to a pre-reading node.
In the embodiment of the present application, if the application of the current start process is a cold start, the read-ahead node is any node before the bind application shown in (c) in fig. 7 starts.
And S112, after monitoring that the application starts, the monitoring module sends a pre-reading instruction to the pre-reading module after going to a pre-reading node.
S113, the pre-reading module carries out system calling and transmits the unique identification and the starting mode of the application which is currently started to the called kernel function.
In the embodiment of the application, each application has a unique identifier and is used for distinguishing different applications so as to obtain a PTE snapshot corresponding to the application; the startup mode identification is used for determining whether to acquire the historical PTE snapshot at the hot startup or the historical PTE snapshot at the cold startup.
The starting mode identifier in the embodiment of the application indicates that the starting is cold starting.
And S114, after the kernel is called by the system, reading the cold-start PTE snapshot corresponding to the application identifier from the disk based on the received application identifier.
And S115, after the kernel reads the PTE snapshot, loading file data corresponding to the PTE snapshot read from the disk in the physical memory.
Subsequently, after the application process completes the process start and successfully applies for the virtual space, the kernel may fill, according to the physical address where the file data loaded in the physical memory is currently located, the PTE information (for example, fill the mapping relationship between the virtual address and the physical address) in the page table of the process corresponding to the application identifier.
By the aid of the preloading mode, file information required in the application cold starting process can be loaded in the physical memory in advance, the process of loading file data in the starting process is saved, PTE information can be filled after the application of the virtual memory is completed in the process starting of the application, the occurrence of page fault abnormity is reduced, and the application cold starting speed is increased.
It should be noted that, in specific implementation, the following logic also exists: if the disk already stores the PTE snapshots of the same application during historical cold start, the PTE snapshots of the same application during cold start do not need to be stored again during subsequent cold start. Correspondingly, when the application is in cold start, only if the disk stores the PTE snapshot of the application in historical cold start, the flow of pre-reading is available.
Referring to fig. 12, a logic flow diagram for application cold start according to an embodiment of the present application is provided.
At a certain moment after the cold start starts, the kernel passively receives pre-reading information (the information is used for indicating pre-reading), the pre-reading information carries an application identifier and a starting mode identifier, and the kernel judges whether a disk has a PTE snapshot corresponding to the application identifier and the starting mode identifier; if the disk has the PTE snapshot corresponding to the application identifier and the starting mode identifier, reading the PTE snapshot from the disk, and loading file data corresponding to the PTE snapshot in a physical memory; of course, if the disk does not have the PTE snapshot corresponding to the application identifier and the start mode identifier, the process ends.
At some point after the start of the cold start, the kernel passively receives capture information (which is used to instruct capturing a PTE snapshot) that is typically received later than the read-ahead information; the capture information carries an application identifier and a starting mode identifier, and the kernel can judge whether the disk has the PTE snapshot corresponding to the application identifier and the starting mode; if the disk does not have the PTE snapshot corresponding to the application identifier and the starting mode identifier, traversing the PTE, generating the PTE snapshot according to the effective file page, and storing the PTE snapshot and the received application identifier and starting mode identifier in the disk in an associated manner; of course, if the disk has the PTE snapshot corresponding to the application identifier and the start mode identifier, the process ends.
In actual application, if an application is uninstalled, a PTE snapshot of the application needs to be deleted from a disk.
Referring to fig. 13, a logic flow diagram when an application is uninstalled is provided according to an embodiment of the present application.
And the kernel receives deletion information (the deletion information is used for indicating deletion of the PTE snapshot), and the deletion information carries the application identifier. The kernel determines whether a PTE snapshot corresponding to the application identifier exists in the disk; if the disk has the PTE snapshot corresponding to the application identifier, deleting the corresponding PTE snapshot represented by the application from the disk; and if the disk does not have the PTE snapshot corresponding to the application identifier, ending the process.
The above embodiment describes the interaction between the modules by taking application cold start as an example, and the interaction between the modules by taking application hot start as an example is described below. The differences between the application of the warm start and the cold start mainly include:
(1) The read ahead timing is different, however, for the kernel, the information indicating read ahead is passively received.
(2) The timing of capturing PTE snapshots may vary. Also, for the kernel, information indicating that a snapshot was captured is passively received.
(3) The page missing information of the generated PTE snapshots is different, and correspondingly, the loaded memory page data is different. When the application is started in a cold state, the kernel can generate PTE snapshots according to all valid file pages of the application, and correspondingly, loaded file data; when the application part is started, the kernel can generate PTE snapshots according to valid file pages and valid anonymous pages of the application part, and when the application part is started, the kernel can also generate PTE snapshots from memory pages which are accessed recently by referring to PTE _ young in PTE status bits, and accordingly, loaded file data and anonymous page data are loaded.
(4) Operations after memory page data corresponding to the PTE snapshot is loaded in the physical memory are different, and during cold start, after the file data corresponding to the PTE snapshot is loaded in the physical memory, the operations of filling the PTE can be continuously executed only after the application process is started and the application of the virtual memory is completed; at warm boot, the process of the application already exists, and the process has already applied for the virtual memory. Therefore, the kernel can establish a mapping relationship between the virtual address and the physical address according to the physical address of the file data loaded in the physical memory, and fill the PTE.
(5) Storage space of the PTE snapshots may be different, and the cold-boot corresponding PTE snapshot needs to be stored in a disk. The corresponding PTE snapshot of the warm boot may be stored in a disk or in a memory. This is because when the process of the application is killed, the relevant information of the application stored in the memory will be cleared. Therefore, even if the PTE snapshot corresponding to the cold start of the application is stored in the memory, the PTE snapshot in the memory is cleared when the application is cold started next time, and pre-reading cannot be performed.
In addition, when the PTE snapshot is stored in the physical memory during the warm boot, the memory space for storing the PTE snapshot, the memory space for storing the page table, and the memory space for storing other data (e.g., a code segment, etc.) of the application are different memory spaces in the physical memory.
Certainly, if the PTE snapshot is stored in the physical memory in advance, the PTE snapshot during the hot start of the application is read from the physical memory during the pre-reading. And if the PTE snapshot is stored in the disk in advance, reading the PTE snapshot during hot start of the application from the disk during pre-reading.
The interaction diagrams between the modules at the time of the hot start of the application can refer to the interaction diagrams between the modules at the time of the cold start of the application shown in fig. 10 and 11.
Referring to fig. 14, a logic diagram of processing a kernel during application warm boot is provided in the present application.
At a certain moment after the start of hot boot, the kernel passively receives pre-reading information (the information is used for indicating to perform pre-reading), the pre-reading information carries an application identifier and a boot mode identifier, and the kernel judges whether a physical memory (or a disk) has a PTE snapshot corresponding to the application identifier and the boot mode identifier; if a physical memory (or a disk) has a PTE snapshot corresponding to the application identifier and the start mode identifier, loading memory page data (including file data and anonymous page data corresponding to a file page) corresponding to the PTE snapshot in the physical memory, and filling PTE information (for example, filling a mapping relationship between a virtual address and a physical address) in a page table according to a physical address where the memory page data is located; of course, if the physical memory (or disk) does not have the PTE snapshot corresponding to the application identifier and the start mode identifier, the process ends.
At some point after the start of the warm boot, the kernel passively receives capture information (which is used to instruct capturing a PTE snapshot) and, in general, the capture information is received later than the pre-read information; the capture information carries an application identifier and a starting mode identifier, and the kernel can judge whether a physical memory (or a disk) has a PTE snapshot corresponding to the application identifier and the starting mode; if the physical memory (or the disk) does not have the PTE snapshot corresponding to the application identifier and the starting mode identifier, traversing the PTE, generating a PTE snapshot according to the effective partial type file page and the effective anonymous page, and storing the PTE snapshot and the received application identifier and starting mode identifier in the physical memory (or the disk) in an associated manner; of course, if the physical memory (or disk) has the PTE snapshot corresponding to the application identifier and the start mode identifier, the process ends.
In actual applications, if an application is uninstalled, a PTE snapshot of the application also needs to be deleted from physical memory (or disk).
As another embodiment of the present application, the starting mode of the application may further include warm start, and the warm start may be combined into one starting mode and adopt the same starting procedure. The application starting method provided by the embodiment of the application can be applied to various starting modes of the application, the application is started for three times on a plurality of applications according to three starting modes, the overall time delay is reduced by 13%, and the IO wait of the UI thread (namely how much time in a sampling period belongs to the CPU idle state and at least one unfinished disk IO request) is reduced by 47%. Specifically, it can be referred to table 1 and fig. 15.
TABLE 1 delay, IOwait and benefit comparison (unit: ms) for native flow and application startup methods provided herein
As can be understood from table 1, by using the method for preloading memory pages in the application starting process provided in the embodiment of the present application, the total time delay can be increased by more than about 10%; more benefits can be increased on the IO wait.
For a clearer comparison between the time delays of the two application start modes, reference may be made to a time delay comparison diagram shown in fig. 15. The total time delay and the IO wait of the application starting mode are obviously lower than those of the original flow.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments may be implemented.
Embodiments of the present application further provide a computer program product, which when run on a first device, enables the first device to implement the steps in the above method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a first device, including recording media, computer Memory, read-only Memory (ROM), random-access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
An embodiment of the present application further provides a chip system, where the chip system includes a processor, the processor is coupled to the memory, and the processor executes a computer program stored in the memory to implement the steps of any of the method embodiments of the present application. The chip system may be a single chip or a chip module composed of a plurality of chips.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (12)
1. A method of preloading document pages, comprising:
the method comprises the steps that a kernel receives pre-reading information, wherein the pre-reading information comprises an identifier of a first application and a cold start identifier;
responding to the pre-reading information, the kernel reads a PTE snapshot corresponding to the identification of the first application from a disk, wherein the PTE snapshot is generated for PTE of a file page based on a page object accessed in the history cold starting process of the first application;
and the kernel loads file data corresponding to the PTE snapshot in the disk into a physical memory.
2. The method of claim 1, wherein prior to the kernel receiving read-ahead information, the method further comprises:
the kernel receives capture information, wherein the capture information comprises an identifier of the first application and a cold start identifier;
responding to the capture information, the kernel generates a PTE snapshot corresponding to the identification of the first application according to a PTE of which a page object in a page table corresponding to the identification of the first application is a file page;
and the kernel stores the PTE snapshot corresponding to the identification of the first application in the disk.
3. The method as claimed in claim 2, wherein said in response to said capturing information, said kernel generating a PTE snapshot corresponding to the identity of said first application from PTEs of said first application that identify the page object in the corresponding page table as a file page, comprises:
in response to the capture information, the kernel determines that a PTE snapshot corresponding to the identification of the first application does not exist in the disk;
and the kernel generates a PTE snapshot corresponding to the identifier of the first application according to a PTE of which a page object in a page table corresponding to the identifier of the first application is a file page.
4. The method as claimed in claim 2 or 3, wherein the kernel generates a PTE snapshot corresponding to the identifier of the first application according to the PTE of which the page object in the page table corresponding to the identifier of the first application is a file page, including:
and the kernel takes the state bit in the page table corresponding to the identifier of the first application as a preset character, the page object is a PTE of a file page, and generates a PTE snapshot corresponding to the identifier of the first application, wherein the preset character is used for indicating that a virtual memory corresponding to the PTE is mapped to a physical memory.
5. The method of any of claims 1 to 3, wherein prior to the kernel receiving the read-ahead information, the method further comprises:
monitoring that the first application is started to a read-ahead node by a monitoring module, wherein the read-ahead node is positioned before an ApplicationStart stage in the application starting process;
the monitoring module sends a pre-reading instruction to the pre-reading module;
and responding to the pre-reading instruction, and transmitting the pre-reading information to the kernel by the pre-reading module through system call.
6. The method of any of claims 2 to 3, wherein prior to the kernel receiving the capture information, the method further comprises:
monitoring that the first application is started to a capture node by a monitoring module, wherein the capture node is positioned at the end of or within the first time after the DoFrame stage in the application starting process;
the monitoring module sends a capture instruction to the pre-reading module;
in response to the capture instruction, the read-ahead module transmits the capture information to the kernel through a system call.
7. The method of any of claims 2 to 3, wherein prior to the kernel receiving the capture information, the method further comprises:
the monitoring module monitors that the first application is started to a capture node, and the capture node is positioned at the end of or within the first time after the activityStart stage in the application starting process;
the monitoring module sends a capture instruction to the pre-reading module;
in response to the capture instruction, the read-ahead module transmits the capture information to the kernel through a system call.
8. The method of any of claims 1 to 3, further comprising:
the kernel receives deletion information, wherein the deletion information comprises an identifier of the first application;
and responding to the deletion information, the kernel deletes the PTE snapshot corresponding to the identification of the first application stored in the disk.
9. The method of claim 8, wherein prior to the kernel receiving deletion information, the method further comprises:
the monitoring module receives an unloading instruction of the first application;
and responding to the uninstalling instruction, and transmitting the deletion information to the kernel by the monitoring module through system call.
10. The method of any one of claims 1 to 3, wherein the PTE comprises a mapping relation between virtual memory and physical memory, and the PTE snapshot comprises a file name of file data stored in a physical address corresponding to the PTE and a storage address of the file data in the disk.
11. An electronic device, characterized in that the electronic device comprises a processor for executing a computer program stored in a memory, so that the electronic device implements the method according to any of claims 1 to 10.
12. A chip system comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the method of any of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310174856.XA CN115858047A (en) | 2023-02-28 | 2023-02-28 | Method for preloading file pages, electronic equipment and chip system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310174856.XA CN115858047A (en) | 2023-02-28 | 2023-02-28 | Method for preloading file pages, electronic equipment and chip system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115858047A true CN115858047A (en) | 2023-03-28 |
Family
ID=85659311
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310174856.XA Pending CN115858047A (en) | 2023-02-28 | 2023-02-28 | Method for preloading file pages, electronic equipment and chip system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115858047A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118444994A (en) * | 2023-10-09 | 2024-08-06 | 荣耀终端有限公司 | File loading method, device and equipment |
WO2024179104A1 (en) * | 2023-02-28 | 2024-09-06 | 荣耀终端有限公司 | Method for preloading memory page, electronic device, and chip system |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040123331A1 (en) * | 2002-10-02 | 2004-06-24 | Kevin Jackman | Cold boot timing |
US20180293079A1 (en) * | 2015-08-31 | 2018-10-11 | Mitsubishi Electric Corporation | Application execution apparatus and application execution method |
CN108763104A (en) * | 2018-05-23 | 2018-11-06 | 北京小米移动软件有限公司 | The method, apparatus and storage medium of pre-read file page |
CN109471671A (en) * | 2017-09-06 | 2019-03-15 | 武汉斗鱼网络科技有限公司 | A kind of program cold start-up method and system |
CN109739642A (en) * | 2018-12-18 | 2019-05-10 | 努比亚技术有限公司 | A kind of CPU frequency modulation method and device, mobile terminal and computer readable storage medium |
CN111061516A (en) * | 2018-10-15 | 2020-04-24 | 华为技术有限公司 | Method and device for accelerating cold start of application and terminal |
US20210318962A1 (en) * | 2020-04-13 | 2021-10-14 | Red Hat, Inc. | Reverse shadow page tables for firewalled nested encrypted virtual machines |
CN113703873A (en) * | 2021-09-03 | 2021-11-26 | 腾讯科技(深圳)有限公司 | Client cold start method, apparatus, medium, device, and program product |
CN114201226A (en) * | 2020-08-26 | 2022-03-18 | 北京小米移动软件有限公司 | Application starting method and device, electronic equipment and storage medium |
CN114461588A (en) * | 2021-08-20 | 2022-05-10 | 荣耀终端有限公司 | Method for adjusting pre-reading window and electronic equipment |
CN114546897A (en) * | 2020-11-26 | 2022-05-27 | 龙芯中科技术股份有限公司 | Memory access method and device, electronic equipment and storage medium |
-
2023
- 2023-02-28 CN CN202310174856.XA patent/CN115858047A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040123331A1 (en) * | 2002-10-02 | 2004-06-24 | Kevin Jackman | Cold boot timing |
US20180293079A1 (en) * | 2015-08-31 | 2018-10-11 | Mitsubishi Electric Corporation | Application execution apparatus and application execution method |
CN109471671A (en) * | 2017-09-06 | 2019-03-15 | 武汉斗鱼网络科技有限公司 | A kind of program cold start-up method and system |
CN108763104A (en) * | 2018-05-23 | 2018-11-06 | 北京小米移动软件有限公司 | The method, apparatus and storage medium of pre-read file page |
CN111061516A (en) * | 2018-10-15 | 2020-04-24 | 华为技术有限公司 | Method and device for accelerating cold start of application and terminal |
CN109739642A (en) * | 2018-12-18 | 2019-05-10 | 努比亚技术有限公司 | A kind of CPU frequency modulation method and device, mobile terminal and computer readable storage medium |
US20210318962A1 (en) * | 2020-04-13 | 2021-10-14 | Red Hat, Inc. | Reverse shadow page tables for firewalled nested encrypted virtual machines |
CN114201226A (en) * | 2020-08-26 | 2022-03-18 | 北京小米移动软件有限公司 | Application starting method and device, electronic equipment and storage medium |
CN114546897A (en) * | 2020-11-26 | 2022-05-27 | 龙芯中科技术股份有限公司 | Memory access method and device, electronic equipment and storage medium |
CN114461588A (en) * | 2021-08-20 | 2022-05-10 | 荣耀终端有限公司 | Method for adjusting pre-reading window and electronic equipment |
CN113703873A (en) * | 2021-09-03 | 2021-11-26 | 腾讯科技(深圳)有限公司 | Client cold start method, apparatus, medium, device, and program product |
Non-Patent Citations (1)
Title |
---|
SUNTORLEARNING: "操作系统‐虚拟内存", pages 1 - 9, Retrieved from the Internet <URL:《https://it.cha138.com/tech/show1314355.html》> * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024179104A1 (en) * | 2023-02-28 | 2024-09-06 | 荣耀终端有限公司 | Method for preloading memory page, electronic device, and chip system |
CN118444994A (en) * | 2023-10-09 | 2024-08-06 | 荣耀终端有限公司 | File loading method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP4002108B1 (en) | Application start method and electronic device | |
CN115858046B (en) | Method for preloading memory pages, electronic equipment and chip system | |
WO2020000448A1 (en) | Flexible screen display method and terminal | |
CN115858047A (en) | Method for preloading file pages, electronic equipment and chip system | |
US20230418736A1 (en) | Virtual Memory Management Method and Electronic Device | |
KR20210042953A (en) | Security service deletion method and electronic device | |
US12086069B2 (en) | Memory management method to determine a frequently accessed page and associated terminal device | |
US20230385112A1 (en) | Memory Management Method, Electronic Device, and Computer-Readable Storage Medium | |
CN110413383B (en) | Event processing method, device, terminal and storage medium | |
CN114461589B (en) | Method for reading compressed file, file system and electronic equipment | |
CN114461375B (en) | Memory resource management method and electronic equipment | |
WO2021185352A1 (en) | Version upgrade method and related apparatus | |
CN111666227B (en) | Page bump protection method and device for memory recovery of operating system | |
WO2023051094A1 (en) | Memory recovery method and apparatus, electronic device, and readable storage medium | |
CN112783418A (en) | Method for storing application program data and mobile terminal | |
CN108132817B (en) | Object management method and device | |
CN111666226B (en) | Page bump protection method for operating system memory recovery and user equipment | |
CN111294470B (en) | Call processing method, device, equipment and storage medium | |
CN114253737A (en) | Electronic device, memory recovery method thereof and medium | |
CN117112046B (en) | Application program starting method and electronic equipment | |
CN117009023B (en) | Method for displaying notification information and related device | |
CN116382809B (en) | Application program starting method and electronic equipment | |
WO2023051178A1 (en) | Task scheduling method, electronic device, chip system, and storage medium | |
CN116069723B (en) | File migration method, electronic equipment and storage medium | |
CN117707561A (en) | Card data updating method, electronic device and computer readable storage 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 |