Embodiments of the invention relate to transfer of data between memory types. More particularly, embodiments of the invention relate to techniques for moving data from a volatile memory to a non-volatile memory.
Electronic devices include a finite amount of memory. Volatile memory types are typically faster than non-volatile memory. Thus, volatile memory is typically used for applications that require minimal memory latency. However, because the volatile memory is finite, there may be conditions that require removing data from the volatile memory to allow other applications or processes to utilize additional memory locations.
The invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings in which like reference numerals refer to similar elements.
In the following description, numerous specific details are set forth. However, embodiments of the invention may be practiced without these specific details. In other instances, well-known circuits, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
On a device with a limited amount of volatile memory (e.g., random access memory, RAM), it may be desirable or even necessary to allocate memory locations used for one process or application to another process or application. For example, a more important application may require more memory locations at the expense of a less important application.
In one embodiment, when the non-volatile memory is a solid-state memory device, it may be desirable to minimize the wear on the device and avoid read/modify/write situations. In one embodiment, the process or application is allowed access to the data after it has been evicted from the volatile memory and has been moved to the non-volatile memory.
In one embodiment, a two-level paging mechanism is used. The first level gathers pages from reclaimable memory locations for a process and compacts the pages into a single container. The second level sends the compact container's contents to a swap file and may use optimal I/O operations to the target memory device. On-demand paging is made possible by having a first pager locate the requested pages in the compact container and then having a second pager retrieve the corresponding pages from the swap file.
This two-level paging mechanism may be useful, for example, in mobile devices that typically have less RAM than physically larger devices, such as desktop computers or even laptop computers. For example, a tablet device, or a notebook computer, or a smartphone may contain a limited amount of RAM and a solid state memory device (e.g., flash memory).
Address space 110 represents the memory that can be used by a given process or application. Address space 110 can contain several memory regions. A memory region can contain several virtual pages. A virtual page can be in one of three states at any time: Unallocated, Resident, or Paged Out.
The primary (RAM, volatile) and secondary (SSD, non-volatile) memories are used by multiple applications during execution of the applications by a host system. Typically, primary memory is a random access memory that is accessible by a processor(s) executing the applications. Address space 110 may use all of, or part of, a random access memory within the host system. Other address spaces are used to support the other processes in the system and they all compete for the limited resources of the primary memory (RAM).
The random access memory is used to support multiple processes and each process may have its own address space to utilize. Address space 110 has one or more memory regions (e.g., 112, 114, 116) that are used by the process to store one or more pages of data.
In the example of
Thus, during operation, memory regions 112, 114 and 116 may be designated for eviction. The eviction process moves the pages from memory regions 112, 114 and 116 to non-volatile memory 150. In one embodiment, this process includes utilization of compact container 130. Compact container 130 may be a region or structure in system RAM outside of address space 110, or compact container 130 may be in a different memory device coupled with system RAM. In one embodiment, compact container 130 is within an operating system kernel address space.
In one embodiment, the pages from memory regions 112, 114 and 116 are stored in a more compact manner (e.g., contiguously, in a minimal number of pages, etc.) within compact container 130. In another embodiment, pointers to the pages may be stored in compact container 130. In one embodiment, the contents of memory regions 112, 114 and 116 are copied to non-volatile memory 150. In one embodiment, the pages are copied to non-volatile memory 150 in a single write operation, or in a single write operation per page.
When pages that have been moved to non-volatile memory 150 are required, the location of the data in non-volatile memory 150 may be determined through compact container 130. The pages may then be transferred back from non-volatile memory 150 to address space 110. The same memory regions may be used, or different memory regions may be used.
When pages for a process are designated for eviction, the address space corresponding to the process is frozen (e.g., 112, 114, 116 of
The address space for the process is walked, at step 220. When walking the address space for the process, information is collected about the pages of memory that are frozen and to be transferred out of RAM. In one embodiment, for pages that are to be transferred out of RAM, pointers for the resident pages are moved to the compact container, at step 230. In another embodiment, the contents of the memory locations may be copied to the compact container to be transferred out of RAM. In one embodiment, pages that share data between multiple processes are not candidates for eviction.
The pages are then copied from RAM to the non-volatile memory (e.g., flash memory), at step 240. In one embodiment, the pages are written to the non-volatile memory in a single I/O operation, which may help reduce wear on the non-volatile memory. In alternate embodiments, multiple write operations may be performed.
The address space locations for which the pages have been moved are reclaimed, at step 250. The reclaimed memory locations can then be used by other processes. The process of
A request is received for the evicted pages, at step 310. The request may be the result of a reactivation, or thawing, of a previously frozen process. The request may be for a portion of the previously evicted pages for the process, or the request may be for all of the previously evicted pages for the process.
The link for the memory locations in the address space (e.g., in RAM) to the compact container are followed, at step 320. The link and/or other information may be utilized to determine the location and/or status of the data in the compact container. The page location is determined, at step 330.
The pages are then copied from the non-volatile memory to RAM, at step 340. In one embodiment, the pages are retrieved by a single read to the non-volatile memory. The non-volatile memory locations can then be used for other data, at step 350.
Data transfer agent 400 includes memory 414, which represents a memory device and/or access to a memory resource for storing data and/or instructions. Memory 414 may include memory local to data transfer agent 400, as well as, or alternatively, including memory of the host system on which data transfer agent 400 resides. Data transfer agent 400 also includes one or more interfaces 416, which represent access interfaces to/from (e.g., an input/output interface, application programming interface) data transfer agent 400 with regard to entities (electronic or human) external to data transfer agent 400.
Data transfer agent 400 also includes data transfer engine 420, which represents one or more functions that enable data transfer agent 400 to provide the zooming in and/or out on pages as described herein. Example modules that may be included in data transfer engine 420 include process memory module 430, compact container manager 440, link manager 450 and memory transfer module 460. As used herein, a module refers to routine, a subsystem, etc., whether implemented in hardware, software, firmware or some combination thereof.
Process memory module 430 operates to determine the status for each process and may also manage other parameters, for example, priorities associated with the processes or allowable memory consumption, etc. Process memory module 430 may control the status of the processes as well. Process memory module 430 may operate to freeze the processes when a higher priority process requires additional memory.
Compact container manager 440 operates to control the operation and functionality of the compact container as described herein. Compact container manager 440 may manage data structures within the compact container as well as links the operation and organization of the compact container to provide the functionality described herein.
Link manager 450 operates to follow and maintain links between data structures and memory locations, for example, between the compact container and the non-volatile memory. Link manager 450 may operate to locate data in non-volatile memory in response to a request for the data to be transferred back to RAM.
Memory transfer module 460 operates to control reads and writes to and from the non-volatile memory. In one embodiment, memory transfer module 460 causes data to be written to the non-volatile memory in a minimum number of write operations. Similarly, memory transfer module 460 causes data to be read from the non-volatile memory in a minimum number of reads. This may reduce wear on the non-volatile memory.
Sensors, devices, and subsystems can be coupled to peripherals interface 506 to facilitate multiple functionalities. For example, motion sensor 510, light sensor 512, and proximity sensor 514 can be coupled to peripherals interface 506 to facilitate the orientation, lighting, and proximity functions. Other sensors 516 can also be connected to peripherals interface 506, such as a positioning system (e.g., GPS receiver), a temperature sensor, a biometric sensor, or other sensing device, to facilitate related functionalities.
Camera subsystem 520 and optical sensor 522 (e.g., a charged coupled device (CCD) or a complementary metal-oxide semiconductor (CMOS) optical sensor) can be utilized to facilitate camera functions, such as recording photographs and video clips.
Communication functions can be facilitated through one or more wireless communication subsystems 524, which can include radio frequency receivers and transmitters and/or optical (e.g., infrared) receivers and transmitters. The specific design and implementation of communication subsystem 524 can depend on the communication network(s) over which the mobile device is intended to operate. For example, a mobile device can include communication subsystems 524 designed to operate over a GSM network, a GPRS network, an EDGE network, a Wi-Fi or WiMax network, and a Bluetooth™ network. In particular, wireless communication subsystems 524 may include hosting protocols such that the mobile device may be configured as a base station for other wireless devices.
Audio subsystem 526 can be coupled to speaker 528 and microphone 530 to facilitate voice-enabled functions, such as voice recognition, voice replication, digital recording, and telephony functions.
I/O subsystem 540 can include touch screen controller 542 and/or other input controller(s) 544. Touch-screen controller 542 can be coupled to touch screen 546. Touch screen 546 and touch screen controller 542 can, for example, detect contact and movement or break thereof using any of a plurality of touch sensitivity technologies, including but not limited to capacitive, resistive, infrared, and surface acoustic wave technologies, as well as other proximity sensor arrays or other elements for determining one or more points of contact with touch screen 546.
Other input controller(s) 544 can be coupled to other input/control devices 548, such as one or more buttons, rocker switches, thumb-wheel, infrared port, USB port, and/or a pointer device such as a stylus. The one or more buttons (not shown) can include an up/down button for volume control of speaker 528 and/or microphone 530.
In one implementation, a pressing of the button for a first duration may disengage a lock of touch screen 546, and a pressing of the button for a second duration that is longer than the first duration may turn power to the mobile device on or off. The user may be able to customize a functionality of one or more of the buttons. Touch screen 546 can, for example, also be used to implement virtual or soft buttons and/or a keyboard.
In some implementations, the mobile device can present recorded audio and/or video files, such as MP3, AAC, and MPEG files. In some implementations, the mobile device can include the functionality of an MP3 player, such as an iPod™. The mobile device may, therefore, include a 32-pin connector that is compatible with the iPod™. Other input/output and control devices can also be used.
Memory interface 502 can be coupled to memory 550. Memory 550 can include high-speed random access memory and/or non-volatile memory, such as one or more magnetic disk storage devices, one or more optical storage devices, and/or flash memory (e.g., NAND, NOR). Memory 550 can store operating system 552, such as Darwin, RTXC, LINUX, UNIX, OSX, WINDOWS, or an embedded operating system such as VxWorks. Operating system 552 may include instructions for handling basic system services and for performing hardware dependent tasks. In some implementations, operating system 552 can be a kernel (e.g., UNIX kernel). Memory interface 502 may also be coupled with non-volatile memory 575, which may be, for example, flash memory.
Memory 550 may also store communication instructions 554 to facilitate communicating with one or more additional devices, one or more computers and/or one or more servers. Memory 550 may include graphical user interface instructions 556 to facilitate graphic user interface processing; sensor processing instructions 558 to facilitate sensor-related processing and functions; phone instructions 560 to facilitate phone-related processes and functions; electronic messaging instructions 562 to facilitate electronic-messaging related processes and functions; web browsing instructions 564 to facilitate web browsing-related processes and functions; media processing instructions 566 to facilitate media processing-related processes and functions; GPS/Navigation instructions 568 to facilitate GPS and navigation-related processes and instructions; camera instructions 570 to facilitate camera-related processes and functions; and/or other software instructions 572 to facilitate other processes and functions (e.g., access control management functions).
Memory 550 may also store other software instructions (not shown), such as web video instructions to facilitate web video-related processes and functions and/or web shopping instructions to facilitate web shopping-related processes and functions. In some implementations, media processing instructions 566 may be divided into audio processing instructions and video processing instructions, for example to facilitate audio processing-related processes and functions and video processing-related processes and functions, respectively. Activation record and International Mobile Equipment Identity (IMEI) 574 or similar hardware identifier can also be stored in memory 550.
Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment.
In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes can be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
5251303 | Fogg et al. | Oct 1993 | A |
5497476 | Oldfield et al. | Mar 1996 | A |
6038571 | Numajiri et al. | Mar 2000 | A |
6640285 | Bopardikar et al. | Oct 2003 | B1 |
6654428 | Bose et al. | Nov 2003 | B1 |
6934755 | Saulpaugh et al. | Aug 2005 | B1 |
6957237 | Traversat et al. | Oct 2005 | B1 |
20030061457 | Geiger et al. | Mar 2003 | A1 |
20050086442 | McBrearty et al. | Apr 2005 | A1 |
20050246513 | Oba | Nov 2005 | A1 |
20060028947 | Elliott et al. | Feb 2006 | A1 |
20080320203 | Fitzgerald | Dec 2008 | A1 |
20100332693 | Ben-Yehuda et al. | Dec 2010 | A1 |
20110022799 | Sugahara | Jan 2011 | A1 |
20110082965 | Koka et al. | Apr 2011 | A1 |
20110145447 | Dimond | Jun 2011 | A1 |
20110173395 | Bhattacharjee et al. | Jul 2011 | A1 |
Number | Date | Country |
---|---|---|
2003076606 | Mar 2003 | JP |
2007013481 | Jan 2007 | JP |
2008217208 | Sep 2008 | JP |
2009503627 | Jan 2009 | JP |
2011028537 | Feb 2011 | JP |
Entry |
---|
A Dwarf. “Any reason not to disable Windows kernel paging?” Sep. 2009. http://superuser.com/questions/41439/any-reason-not-to-disable-windows-kernel-paging. |
Bernard S. Greenberg and Steven Webber. “The Multics Multilevel Paging Hierarchy.” 1975. IEEE Intercon. |
Michael Ismert. “Making Commodity PCs Fit for Signal Processing.” Jun. 1998. USENIX. No. 98. |
Jason Parker. “Symbian OS Internals/02. Hardware for Symbian OS.” Jan. 2011. http://www.developer.nokia.com/Community/Wiki/index.php?title=Symbian—OS—Internals/02.—Hardware—for—Symbian—OS&oldid=83584. |
Phillip Krueger and Rohit Chawla. “The Stealth Distributed Scheduler.” May 1991. IEEE. ICDCS 1991. pp. 336-343. |
Walling. “ATA/ATAPI using DMA.” Feb. 2009. http://wiki.osdev.org/index.php?title=ATA/ATAPI—using—DMA&oldid=7174. |
Bovet et al. Understanding the Linux Kernel. Dec. 2002. O'Reilly. 2nd ed. Section 13.4. |
Joo et al. “Demand Paging for OneNAND™ Flash eXecute-In-Place.” Oct. 2006. ACM. CODES+ISSS '06. pp. 229-234. |
PCT Search Report; Application No. PCT/US2012/044351, dated Oct. 24, 2012. |
PCT Written Opinion; Application No. PCT/US2012/044351, dated Oct. 24, 2012. |
Number | Date | Country | |
---|---|---|---|
20130007345 A1 | Jan 2013 | US |