TWI430175B - A fast switching method for hybrid storage devices - Google Patents
A fast switching method for hybrid storage devices Download PDFInfo
- Publication number
- TWI430175B TWI430175B TW100111237A TW100111237A TWI430175B TW I430175 B TWI430175 B TW I430175B TW 100111237 A TW100111237 A TW 100111237A TW 100111237 A TW100111237 A TW 100111237A TW I430175 B TWI430175 B TW I430175B
- Authority
- TW
- Taiwan
- Prior art keywords
- storage unit
- memory
- file
- fast switching
- sleep
- Prior art date
Links
Landscapes
- Stored Programmes (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Description
本發明係有關一種快速開關機的方法,特別是關於一種應用於混合式儲存裝置之快速開關機方法。 The present invention relates to a method of quickly switching machines, and more particularly to a fast switching machine method for a hybrid storage device.
【先前技術】一般電腦系統的工作狀態,除了正在執行作業系統與各種應用程式的模式之外,更包含可節省電力之省電模式,尤其是筆記型電腦或平板電腦。電腦系統進入休眠之目的一方面為節省電能的消耗,另一方面則為能防止電腦系統因突然喪失電力資料的遺失與受損程度。 [Prior Art] The working state of a general computer system, in addition to the mode in which the operating system and various applications are being executed, includes a power saving mode that can save power, especially a notebook computer or a tablet computer. The purpose of the computer system to go to sleep is to save energy consumption on the one hand, and to prevent the loss and damage of the computer system due to sudden loss of power data on the other hand.
依據高等組態能源介面(Advanced Configuration & Power Interface,ACPI)的設計分類,最常見的休眠分為兩種型態,一種為Suspend To RAM(STR)模式,稱為S3狀態,S3狀態為只對部份的揮發性記憶體持續供電,包括視訊緩衝記憶體(Frame Buffer)與主記憶體(Main Memory)等,其餘部分一律斷電。S3狀態具有返回到全速運作的時間較快的優點。另一種休眠型態為spend To Disk(STD)模式,稱為S4狀態,S4狀態是將目前工作中的資料全部皆寫入到非揮發性記憶體內儲存,然後系統將全部斷電,S4的優點為其更為省電。 According to the design classification of Advanced Configuration & Power Interface (ACPI), the most common types of sleep are divided into two types, one is Suspend To RAM (STR) mode, called S3 state, and the S3 state is only Some of the volatile memory is continuously powered, including the Frame Buffer and Main Memory, and the rest is powered off. The S3 state has the advantage of returning to full speed for a faster time. Another type of sleep is the Send To Disk (STD) mode, which is called the S4 state. The S4 state is to write all the data in the current work to the non-volatile memory, and then the system will be powered off. The advantages of S4 It is more energy efficient.
然而,承上所述之兩種休眠S3狀態與S4狀態,皆不盡完善;例如,在進入S3狀態後,仍需提供電力給電腦系統中揮發性記憶體,以維持系統儲存的狀態;若改採用S4狀態雖相較於S3狀態省電, 但返回至電腦系統全速運作的速度則相對於S3狀態緩慢許多。 However, the two sleep S3 states and the S4 state described above are not perfect; for example, after entering the S3 state, it is still necessary to provide power to the volatile memory in the computer system to maintain the state of the system storage; Switching to the S4 state saves power compared to the S3 state. But the speed of returning to the computer system at full speed is much slower than the S3 state.
有鑑於此,本發明係在針對上述先前技術中休眠狀態存在之缺失,提出一種應用於混合式儲存裝置之快速開關機的方法,以改善現有休眠狀態的缺失。 In view of the above, the present invention proposes a method for a fast switching machine of a hybrid storage device to improve the absence of the existing sleep state in view of the absence of the sleep state in the prior art described above.
本發明之主要目的係在提出一種應用於混合式儲存裝置之快速開關機的方法,其係利用混合式儲存裝置的隨機存取特性與循序存取特性,將記憶體分頁分別存放於混合式儲存裝置中的不同儲存單元,使電腦系統於進入休眠時能夠減少目前記憶體使用量,進而增進電腦系統重新啟動至全速運作的反應效率。 The main object of the present invention is to provide a method for quickly switching on and off a hybrid storage device, which utilizes random access characteristics and sequential access characteristics of a hybrid storage device to store memory pages separately in hybrid storage. The different storage units in the device enable the computer system to reduce the current memory usage when entering the sleep state, thereby improving the reaction efficiency of the computer system restarting to full speed operation.
為達到上述目的,本發明之快速開關機方法主要使用一混合式儲存裝置,其係包含有至少一可快速隨機存取之第一儲存單元以及至少一大容量的第二儲存單元,此快速開關機方法包括有下列步驟:在一電腦系統進入休眠時,對至少一主記憶體進行置換(swap-out),將可置換的記憶體分頁儲存至第一儲存單元,以及將不可置換的記憶體分頁儲存至第一儲存單元或第二儲存單元之至少一休眠檔中;當電腦系統重新啟動後,電腦系統先讀取休眠檔,並將休眠檔回復儲存至主記憶體中;然後,再利用分頁技術或是需求分頁技術,至少自第一儲存單元中讀取記憶體分頁的資料,並將其載入至主記憶體中。 In order to achieve the above object, the fast switching machine method of the present invention mainly uses a hybrid storage device, which comprises at least one first storage unit that can be quickly random accessed and a second storage unit that has at least one large capacity. The method includes the steps of: swapping at least one main memory when a computer system goes to sleep, storing the replaceable memory in the first storage unit, and replacing the non-replaceable memory The paging is stored in at least one sleep file of the first storage unit or the second storage unit; when the computer system is restarted, the computer system reads the sleep file first, and restores the sleep file to the main memory; then, reuses The paging technology or the demand paging technology reads at least the memory page data from the first storage unit and loads it into the main memory.
底下藉由具體實施例配合所附的圖式詳加說明,當更容易瞭解本發明之目的、技術內容、特點及其所達成之功效。 The purpose, technical contents, features and effects achieved by the present invention will be more readily understood by the detailed description of the embodiments and the accompanying drawings.
10‧‧‧電腦系統 10‧‧‧ computer system
12‧‧‧處理器 12‧‧‧ Processor
14‧‧‧主記憶體 14‧‧‧ main memory
16‧‧‧混合式儲存裝置 16‧‧‧Mixed storage device
18‧‧‧第一儲存單元 18‧‧‧First storage unit
182‧‧‧第一置換空間 182‧‧‧First replacement space
184‧‧‧第一休眠檔 184‧‧‧First dormant file
20‧‧‧第二儲存單元 20‧‧‧Second storage unit
202‧‧‧檔案系統 202‧‧‧File System
204‧‧‧第二置換空間 204‧‧‧Second replacement space
206‧‧‧第二休眠檔 206‧‧‧second sleep file
第1圖為本發明使用之電腦系統的系統架構圖。 Figure 1 is a system architecture diagram of a computer system used in the present invention.
第2圖為本發明進行快速開關機之流程示意圖。 Figure 2 is a schematic flow chart of the fast switching machine of the present invention.
本發明提出一種應用於混合式儲存裝置之快速開關機的方法,其係可在電腦系統進入休眠時,利用混合式儲存裝置的設計,再搭配空白記憶體分頁可以依照其使用狀況寫入存取速度較快之儲存單元的主要特色,有效減少記憶體分頁存放至儲存裝置的數量,並同時加快電腦系統從休眠重新啟動至全速工作的速度。 The invention provides a method for fast switching machine of a hybrid storage device, which can utilize the design of the hybrid storage device when the computer system enters sleep state, and can be written and accessed according to the usage condition of the blank memory paging. The main feature of the faster storage unit is to reduce the amount of memory stored in the storage device and speed up the computer system from sleep to full speed.
在詳細說明本發明之快速開關機方法之前,將先詳述本發明所使用之電腦系統的系統架構圖,請參閱第1圖所示,此電腦系統10包含有一處理器12,例如微處理器或中央處理器(CPU),以及至少一主記憶體與一混合式儲存裝置,處理器12可對主記憶體14及混合式儲存裝置16進行資料存取。其中,此混合式儲存裝置16包含有至少一可快速隨機存取之第一儲存單元18以及至少一第二儲存單元20,可快速隨機存取之第一儲存單元18係為快閃記憶體(Flash)或高速儲存裝置,第二儲存單元20則為磁碟機(hard disk)或低速儲存裝置,以利用快閃記憶體具有較為良好的隨機隨取特性,再搭配磁碟機較為便宜的儲存媒介。其中,第一儲存單元18除了包含了第一置換空間182,還包含第一休眠檔184;另外,此第一休眠檔184亦可為第一置換空間182的一部份。第二儲存單元20除了包含了主要的檔案系統202,更包含第二置換空間204以及第二休眠檔206;另外,第二休眠檔206亦可為檔案系統202或第二置換空間204的一部份。 Before describing in detail the method of the fast switching machine of the present invention, a system architecture diagram of a computer system used in the present invention will be described in detail. Referring to FIG. 1, the computer system 10 includes a processor 12, such as a microprocessor. Or a central processing unit (CPU), and at least one main memory and a hybrid storage device, the processor 12 can access the main memory 14 and the hybrid storage device 16. The hybrid storage device 16 includes at least one first storage unit 18 that can be quickly random accessed and at least one second storage unit 20, and the first storage unit 18 that can be quickly and randomly accessed is a flash memory ( Flash) or high-speed storage device, the second storage unit 20 is a hard disk or a low-speed storage device, so that the flash memory has better random access characteristics, and the disk drive is cheaper to store. medium. The first storage unit 18 includes a first dormant space 184 in addition to the first replacement space 182. The first dormant file 184 may also be a part of the first replacement space 182. The second storage unit 20 includes a second replacement space 204 and a second sleep file 206. The second sleep file 206 can also be a file system 202 or a second replacement space 204. Share.
接續請同時參閱第1圖的系統架構以及第2圖之流程圖來詳細說明本發明之快速開關機方法。如第1圖及第2圖所示,首先,如步驟 S10所示,於一電腦系統進入休眠時,電腦系統10之處理器12對主記憶體14進行置換(swap-out),將主記憶體14中可置換的記憶體分頁儲存至第一儲存單元18中之第一置換空間182;以及將不可置換(non-swappable)的記憶體分頁儲存至混合儲存裝置16之至少一休眠檔中,即此電腦系統10可以依據第一休眠檔184及第二休眠檔206的循序寫入速度或可寫入次數,決定不可置換的記憶體分頁應該寫入到第一休眠檔184或第二休眠檔206,例如,不可置換的記憶體分頁係儲存在第一儲存單元18內之第一休眠檔184,或是儲存於第二儲存單元20內之第二休眠檔206,當然亦可同時儲存在第一休眠檔184及第二休眠檔206。在這個實施例中,第二儲存單元20(磁碟機)的隨機存取速度較低,而第一儲存單元18(快閃記憶體)的隨機存取速度很快,故於於循序存取速度方面,第一儲存單元18速度略快於第二儲存單元20,但快閃記憶體的寫入次數有限,因此電腦系統10可以依照設計目標,使用第一休眠檔184或第二休眠檔206,或者同時使用第一及第二休眠檔184、206,以藉由平行存取提升讀取休眠檔的速度。 Next, please refer to the system architecture of FIG. 1 and the flowchart of FIG. 2 to explain in detail the fast switching machine method of the present invention. As shown in Figures 1 and 2, first, as steps As shown in S10, when a computer system goes to sleep, the processor 12 of the computer system 10 swaps the main memory 14 to store the replaceable memory in the main memory 14 to the first storage unit. The first replacement space 182 of 18; and the non-swappable memory is stored in the at least one sleep file of the hybrid storage device 16, that is, the computer system 10 can be based on the first sleep file 184 and the second The sequential write speed or the number of writes of the sleep file 206 determines that the non-replaceable memory page should be written to the first sleep file 184 or the second sleep file 206. For example, the non-replaceable memory page is stored in the first The first dormant file 184 in the storage unit 18 or the second dormant file 206 stored in the second storage unit 20 may of course be stored in the first dormant file 184 and the second dormant file 206 at the same time. In this embodiment, the random access speed of the second storage unit 20 (disk drive) is low, and the random access speed of the first storage unit 18 (flash memory) is fast, so sequential access is achieved. In terms of speed, the first storage unit 18 is slightly faster than the second storage unit 20, but the number of writes of the flash memory is limited, so the computer system 10 can use the first sleep file 184 or the second sleep file 206 according to the design goal. The first and second sleep stalls 184, 206 are used simultaneously to increase the speed at which the sleep stall is read by parallel access.
再者,上述之可置換的記憶體分頁更可區分為空白記憶體分頁(clean pages)以及非空白記憶體分頁(dirty pages);而在可置換的記憶體分頁中,非空白記憶體分頁或空白記憶體分頁係寫入至第一置換空間182;並將使用機率極低之非空白記憶體分頁則寫入至第二置換空間204或檔案系統202中;亦將使用機率極低之空白記憶體分頁係直接棄置不儲存,以節省儲存空間與時間。另外,在電腦系統10進入休眠時,更可將現在或未來可能常用到的記憶體分頁,自第二儲存單元20之第二置換空間204或檔案系統202中重新寫入至第一儲存單元18的第一置換空間182。甚至, 如果是現在或未來可能常用到的記憶體分頁,例如作業系統登入畫面,則可以在進行置換步驟之前,直接寫入主記憶體中儲存;而在置換步驟開始以後,此記憶體分頁因為是最近被使用過的記憶體分頁,將依照其特性(可置換或不可置換)被寫出到第一置換空間或第一休眠檔。當然,若是不重要的記憶體分頁,例如很少使用到的記憶體分頁,這些未來使用性不大的記憶體分頁如果是空白記憶體分頁則可直接捨棄不儲存;若是非空白記憶體分頁,則可依記憶體的特性(named page or anonymous pages),選擇寫入至第二儲存單元20之第二置換空間204或檔案系統202中。 Furthermore, the above-described replaceable memory page can be further divided into blank memory pages and dirty pages; and in the replaceable memory page, non-blank memory pages or The blank memory page is written to the first replacement space 182; and the non-blank memory page with very low probability is written into the second replacement space 204 or the file system 202; a blank memory with a very low probability is also used. The body page is directly discarded and not stored to save storage space and time. In addition, when the computer system 10 enters the sleep state, the memory that may be commonly used in the current or future may be paged, and rewritten from the second replacement space 204 or the file system 202 of the second storage unit 20 to the first storage unit 18 . The first replacement space 182. even, If it is a memory page that may be used now or in the future, such as the operating system login screen, it can be directly written to the main memory for storage before the replacement step; and after the replacement step starts, the memory page is because it is the most recent. The used memory page will be written out to the first permutation space or the first dormant file according to its characteristics (replaceable or non-replaceable). Of course, if it is an unimportant memory page, such as a memory page that is rarely used, these memory pages that are not useful in the future can be discarded directly if they are blank memory pages; if they are non-blank memory pages, The second replacement space 204 or the file system 202 can be selected to be written to the second storage unit 20 according to the named page or anonymous pages.
接著,如步驟S12所示重新啟動電腦系統10,此時,將依照電腦系統10關機休眠時所使用的休眠檔位置,使處理器12讀取第一休眠檔184或/及第二休眠檔206,並將休眠檔184/206回復儲存至主記憶體14中。 Then, the computer system 10 is restarted as shown in step S12. At this time, the processor 12 reads the first sleep file 184 or/and the second sleep file 206 according to the sleep position used when the computer system 10 is turned off. And the sleep file 184/206 is restored and stored in the main memory 14.
最後,如步驟S14所示,電腦系統10利用分頁技術(paging)或是需求分頁技術(demand paging),主要至少自第一儲存單元18中之第一置換空間182讀取記憶體分頁的資料,並載入至主記憶體14中。當然,若記憶體分頁同時儲存在第一儲存單元18和第二儲存單元20中,則電腦系統10則分別從第一置換空間182、第二置換空間204、檔案系統202中載入所需的記憶體分頁等資料。如果所需之記憶體分頁存在多個副本於第一置換空間182、第二置換空間204或檔案系統202中,那麼電腦系統10將自這三個位置中挑選具有最新內容的記憶體分頁,並將此記憶體分頁載入到主記憶體14中,以進行正常操作。 Finally, as shown in step S14, the computer system 10 uses at least paging or demand paging to read at least the memory page data from the first replacement space 182 in the first storage unit 18. And loaded into the main memory 14. Of course, if the memory page is simultaneously stored in the first storage unit 18 and the second storage unit 20, the computer system 10 loads the required content from the first replacement space 182, the second replacement space 204, and the file system 202, respectively. Memory paging and other information. If there are multiple copies of the desired memory page in the first replacement space 182, the second replacement space 204, or the file system 202, the computer system 10 will sort the memory with the latest content from the three locations, and This memory is paged into the main memory 14 for normal operation.
本發明於電腦系統進入休眠時,電腦系統中可置換的記憶體分頁 (包含空白記憶體分頁及非空白記憶體分頁),存放於第一置換空間(即快閃記憶體的置換空間),由於這些記憶體分頁是目前使用者正在使用或過去一段時間曾經使用的記憶體分頁,因此在下次重新開機後,使用者也很可能再次使用到這些記憶體分頁;再加上快閃記憶體具有良好的隨機存取特性,而分頁機制及需求分頁機制將造成大量的隨機存取,因此將這些記憶體分頁存放於可快速隨機存取之第一儲存單元(快閃記憶體)中可以有效的提升開機及關機效能。 The invention can replace the memory page in the computer system when the computer system enters sleep mode (including blank memory paging and non-blank memory paging), stored in the first replacement space (ie, the replacement space of the flash memory), because these memory paging is the memory that the user is currently using or used in the past period of time. The body is divided into pages, so after the next reboot, the user is likely to use these memory pages again; plus the flash memory has good random access characteristics, and the paging mechanism and the demand paging mechanism will cause a large number of random Access, so the storage of these memory pages in the first storage unit (flash memory) that can be quickly random access can effectively improve the boot and shutdown performance.
因此,本發明之快速開關機的方法係利用混合式儲存裝置的隨機存取特性以及循序存取特性,將記憶體分頁分別存放於混合式儲存裝置中不同的儲存單元,使電腦系統在進入休眠時能夠有效降低目前記憶體使用量,並增進電腦系統重新啟動至全速運作的反應效率。 Therefore, the method of the fast switching machine of the present invention utilizes the random access characteristic and the sequential access characteristic of the hybrid storage device to store the memory pages separately in different storage units in the hybrid storage device, so that the computer system enters the sleep state. It can effectively reduce the current memory usage and improve the response efficiency of the computer system to restart to full speed operation.
以上所述之實施例僅係為說明本發明之技術思想及特點,其目的在使熟習此項技藝之人士能夠瞭解本發明之內容並據以實施,當不能以之限定本發明之專利範圍,即大凡依本發明所揭示之精神所作之均等變化或修飾,仍應涵蓋在本發明之專利範圍內。 The embodiments described above are merely illustrative of the technical spirit and the features of the present invention, and the objects of the present invention can be understood by those skilled in the art, and the scope of the present invention cannot be limited thereto. That is, the equivalent variations or modifications made by the spirit of the present invention should still be included in the scope of the present invention.
10‧‧‧電腦系統 10‧‧‧ computer system
12‧‧‧處理器 12‧‧‧ Processor
14‧‧‧主記憶體 14‧‧‧ main memory
16‧‧‧混合式儲存裝置 16‧‧‧Mixed storage device
18‧‧‧第一儲存單元 18‧‧‧First storage unit
182‧‧‧第一置換空間 182‧‧‧First replacement space
184‧‧‧第一休眠檔 184‧‧‧First dormant file
20‧‧‧第二儲存單元 20‧‧‧Second storage unit
202‧‧‧檔案系統 202‧‧‧File System
204‧‧‧第二置換空間 204‧‧‧Second replacement space
206‧‧‧第二休眠檔 206‧‧‧second sleep file
Claims (13)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW100111237A TWI430175B (en) | 2011-03-31 | 2011-03-31 | A fast switching method for hybrid storage devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW100111237A TWI430175B (en) | 2011-03-31 | 2011-03-31 | A fast switching method for hybrid storage devices |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201239761A TW201239761A (en) | 2012-10-01 |
TWI430175B true TWI430175B (en) | 2014-03-11 |
Family
ID=47599611
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW100111237A TWI430175B (en) | 2011-03-31 | 2011-03-31 | A fast switching method for hybrid storage devices |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI430175B (en) |
-
2011
- 2011-03-31 TW TW100111237A patent/TWI430175B/en not_active IP Right Cessation
Also Published As
Publication number | Publication date |
---|---|
TW201239761A (en) | 2012-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4281421B2 (en) | Information processing system, control method therefor, and computer program | |
KR101713051B1 (en) | Hybrid Memory System and Management Method there-of | |
US8788777B2 (en) | Memory on-demand, managing power in memory | |
US8972651B2 (en) | Storage system and storage method | |
CN105630700B (en) | A kind of storage system and reading/writing method with secondary cache structure | |
EP2416229B1 (en) | Information processing device, power control method, and program | |
US20160062691A1 (en) | Method for controlling memory device to achieve more power saving and related apparatus thereof | |
US20100318727A1 (en) | Memory system and related method of loading code | |
WO2015149577A1 (en) | Storage system, storage device and data storage method | |
US12019544B2 (en) | Memory mapping for hibernation | |
JP2010211734A (en) | Storage device using nonvolatile memory | |
WO2005069148A2 (en) | Memory management method and related system | |
KR101799292B1 (en) | Electronic device and booting method thereof | |
CN105608016B (en) | Solid state hard disk of the DRAM in conjunction with MRAM and the storage card using MRAM | |
CN1783025A (en) | Embedded system data back-up device and method | |
US10146483B2 (en) | Memory system | |
US20110087901A1 (en) | Fast speed computer system power-on & power-off method | |
CN103914325B (en) | Shutdown and startup method and system of Linux system based on hybrid memory | |
CN102736928B (en) | Fast wake-up computer system method and computer system | |
TWI399637B (en) | Fast switch machine method | |
CN105630699B (en) | A kind of solid state hard disk and read-write cache management method using MRAM | |
JP3541349B2 (en) | Cache memory backup system | |
TWI430175B (en) | A fast switching method for hybrid storage devices | |
US11861781B2 (en) | Graphics processing units with power management and latency reduction | |
JP6788566B2 (en) | Computing system and how it works |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |