CN103514109B - A kind of method and apparatus opening disk write cache - Google Patents

A kind of method and apparatus opening disk write cache Download PDF

Info

Publication number
CN103514109B
CN103514109B CN201310438672.6A CN201310438672A CN103514109B CN 103514109 B CN103514109 B CN 103514109B CN 201310438672 A CN201310438672 A CN 201310438672A CN 103514109 B CN103514109 B CN 103514109B
Authority
CN
China
Prior art keywords
queue
write
disk
sync
done
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.)
Active
Application number
CN201310438672.6A
Other languages
Chinese (zh)
Other versions
CN103514109A (en
Inventor
余海滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Innovation Technology Co., Ltd.
Shenzhen Innovation Software Technology Co., Ltd.
Original Assignee
CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Innovation And Technology Storage Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd, Innovation And Technology Storage Technology Co Ltd filed Critical CHUANGXINKE SOFTWARE TECHNOLOGY (SHENZHEN) Co Ltd
Priority to CN201310438672.6A priority Critical patent/CN103514109B/en
Publication of CN103514109A publication Critical patent/CN103514109A/en
Application granted granted Critical
Publication of CN103514109B publication Critical patent/CN103514109B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses the method and apparatus opening disk write cache: set up 3 queues within the storage system, be respectively Pending queue, Done queue and Sync queue; When often receiving a write order, this write order is joined in Pending queue; For each write order in Pending queue, when a predetermined condition is satisfied, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue; When meeting predetermined condition at every turn, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively; When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.Apply scheme of the present invention, the serviceability of disk can be improved.

Description

A kind of method and apparatus opening disk write cache
Technical field
The present invention relates to memory technology, particularly a kind of method and apparatus opening disk write cache.
Background technology
In existing storage system, usually all adopt and close the mode that buffer memory (cache) write by disk (Disk).
Compared to the mode of closing disk write cache, the mode opening disk write cache can improve the serviceability of disk better, as accelerated the processing speed, reduction time delay etc. of disk; But also there is no a kind of mode opening disk write cache preferably in prior art.
Summary of the invention
In view of this, the invention provides a kind of method and apparatus opening disk write cache, the serviceability of disk can be improved.
In order to achieve the above object, technical scheme of the present invention is achieved in that
Open a method for disk write cache, comprising:
Set up 3 queues within the storage system, be respectively Pending queue, Done queue and Sync queue;
When often receiving a write order, this write order is joined in Pending queue;
For each write order in Pending queue, when a predetermined condition is satisfied, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue;
When meeting predetermined condition at every turn, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively;
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
Open a device for disk write cache, comprising:
First processing module, for setting up 3 queues within the storage system, is respectively Pending queue, Done queue and Sync queue;
Second processing module, for when often receiving a write order, joins this write order in Pending queue;
For each write order in Pending queue, when a predetermined condition is satisfied, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue;
When meeting predetermined condition at every turn, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively;
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
Visible, adopt scheme of the present invention, by write order is shifted etc. between set up three queues, achieve and open disk write cache, thus improve the serviceability of disk.
Accompanying drawing explanation
Fig. 1 is the process flow diagram that the present invention opens the embodiment of the method for disk write cache.
Fig. 2 is write order situation first schematic diagram included in the present invention's three queues.
Fig. 3 is write order situation second schematic diagram included in the present invention's three queues.
Fig. 4 is write order situation the 3rd schematic diagram included in the present invention's three queues.
Fig. 5 is write order situation the 4th schematic diagram included in the present invention's three queues.
Fig. 6 is write order situation the 5th schematic diagram included in the present invention's three queues.
Fig. 7 is the composition structural representation that the present invention opens the device embodiment of disk write cache.
Embodiment
For problems of the prior art, propose a kind of scheme opening disk write cache in the present invention, the serviceability of disk can be improved.
In order to make technical scheme of the present invention clearly, understand, to develop simultaneously embodiment referring to accompanying drawing, scheme of the present invention be described in further detail.
Fig. 1 is the process flow diagram that the present invention opens the embodiment of the method for disk write cache.As shown in Figure 1,11 ~ 15 are comprised the following steps.
Step 11: set up 3 queues within the storage system, is respectively Pending queue, Done queue and Sync queue.
When initially setting up, in three queues, be sky.
Wherein, Pending queue: for preserving all write orders not yet returning processing response from disk;
Done queue: allly return processing response from disk for preserving but also do not perform the write order of sync order;
Sync queue: all just at the write order of timing disk buffer memory for preserving.
Step 12: when often receiving a write order, joins this write order in Pending queue.
In this step, when often receiving a write order, according to the difference in functionality of three queues, it is first joined in Pending queue.
Fig. 2 is write order situation first schematic diagram included in the present invention's three queues.As shown in Figure 2, suppose to have received three write orders, be respectively Write1toDisk1, Write2toDisk2 and Write3toDisk1, so, these three write orders are all joined in Pending queue, now, in Done queue and Sync queue, be sky.
Step 13: for each write order in Pending queue, when a predetermined condition is satisfied, is issued to this write order in corresponding disk, and when receiving the processing response that disk returns, is transferred to Done queue by this write order from Pending queue.
Described predetermined condition specifically refers to which kind of condition can be decided according to the actual requirements, such as: through scheduled duration.
For each write order in Pending queue, be issued to after in corresponding disk, disk can process this write order according to existing mode, after being disposed, can return processing response; Correspondingly, when receiving the processing response that disk returns, then this write order can be transferred to Done queue from Pending queue.
Fig. 3 is write order situation second schematic diagram included in the present invention's three queues.As shown in Figure 3, situation shown in composition graphs 2, suppose to have have received for Write1toDisk1 and Write3toDisk1 the processing response returned from Disk1, have received the processing response returned from Disk2 for Write2toDisk2, so then Write1toDisk1, Write2toDisk2 and Write3toDisk1 have been transferred to Done queue from Pending queue; Suppose that Write4toDisk1, Write5toDisk2 and Write6toDisk3 are the write order newly received, so then Write4toDisk1, Write5toDisk2 and Write6toDisk3 are all joined in Pending queue.
All write orders in Done queue are all transferred in Sync queue by step 14: when meeting predetermined condition at every turn, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively.
Described predetermined condition specifically refers to which kind of condition can be decided according to the actual requirements.
Such as: when the write order quantity in Done queue reaches predetermined threshold at every turn, or, often after scheduled duration, then all write orders in Done queue all can be transferred in Sync queue.
Afterwards, for the disk corresponding to all write orders in Sync queue, sync order can be performed respectively, namely calls sync order, how to call as prior art.
Fig. 4 is write order situation the 3rd schematic diagram included in the present invention's three queues.As shown in Figure 4, situation shown in composition graphs 3, supposes to have passed through scheduled duration, so then transfers to Sync queue by Write1toDisk1, Write2toDisk2 and the Write3toDisk1 in Done queue from Done queue, and for Disk1 and Disk2, perform sync order respectively; Suppose the processing response that now have received for Write4toDisk1, Write5toDisk2 and Write6toDisk3, so then Write4toDisk1, Write5toDisk2 and Write6toDisk3 are transferred to Done queue from Pending queue; Suppose now also newly to have received a Write7toDisk3, so then Write7toDisk3 is joined in Pending queue.
Step 15: when receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
As described in step 14, for the disk corresponding to all write orders in Sync queue, perform sync order respectively, how each disk carries out relevant treatment according to sync order is prior art, after being disposed, can return sync response.
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue all can be deleted, and, correspondingly can discharge the internal memory shared by deleted write order, to save memory headroom, how to discharge and be similarly prior art.
Fig. 5 is write order situation the 4th schematic diagram included in the present invention's three queues.As shown in Figure 5, situation shown in composition graphs 4, suppose to have received the sync response that Disk1 returns, so then Write1toDisk1 and Write3toDisk1 can be deleted from Sync queue, and discharge the internal memory shared by Write1toDisk1 and Write3toDisk1.
In addition, also propose in scheme of the present invention: when storage system power down, all write orders in Pending queue, Done queue and Sync queue all can be saved in system disk; When storage system powers on, all write orders be kept in system disk can be taken out, and all write orders taken out all are joined in Pending queue, follow-uply carry out processing according to related procedure shown in Fig. 1.
System disk is usually located on mainboard, when after storage system power down, conventionally, power supply mainboard having the short time retains mainboard to be carried out to relevant protection, this characteristic of mainboard can be utilized in scheme of the present invention, when storage system power down, all write orders in Pending queue, Done queue and Sync queue are all saved in system disk, then normal shutdown; When storage system powers on, all write orders be kept in system disk are all read out, and can think that these write orders are not all persisted in disk, therefore they are all joined in Pending queue.
Fig. 6 is write order situation the 5th schematic diagram included in the present invention's three queues.As shown in Figure 6, situation shown in composition graphs 5, when storage system powers on, by Write4toDisk1, Write5toDisk2 and Write6toDisk3 in the Write7toDisk3 in former Pending queue, former Done queue, and the Write2toDisk2 in former Sync queue all joins in Pending queue, now, sky is in Done queue and Sync queue; It should be noted that, the putting in order to be only of each write order shown in Fig. 6 illustrates, specifically how sorting is not restricted.
Based on above-mentioned introduction, Fig. 7 is the composition structural representation that the present invention opens the device embodiment of disk write cache.As shown in Figure 7, comprising:
First processing module, for setting up 3 queues within the storage system, is respectively Pending queue, Done queue and Sync queue;
Second processing module, for when often receiving a write order, joins this write order in Pending queue;
For each write order in Pending queue, when a predetermined condition is satisfied, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue;
When meeting predetermined condition at every turn, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively;
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
Particularly,
When the write order quantity in Done queue reaches predetermined threshold at every turn, or often after scheduled duration, all write orders in Done queue are then all transferred in Sync queue by the second processing module.
In addition,
Second processing module also can be further used for, and after all being deleted by all write orders corresponding with this disk in Sync queue, discharges the internal memory shared by write order deleted.
Further,
As shown in Figure 7, also can comprise further in this device: the 3rd processing module;
All write orders in Pending queue, Done queue and Sync queue, for when storage system power down, are all saved in system disk by the 3rd processing module;
When storage system powers on, take out all write orders be kept in system disk, and all write orders taken out all are joined in Pending queue.
The specific works flow process of Fig. 7 shown device embodiment please refer to the respective description in preceding method embodiment, repeats no more herein.
In a word, adopt scheme of the present invention, achieve and open disk write cache, thus improve the serviceability of disk; And, when storage system power down, in time all write orders be not synchronized in disk all can be saved in system disk, thus avoid loss of data, and then ensure that the security of data.
In sum, these are only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. open a method for disk write cache, it is characterized in that, comprising:
Set up 3 queues within the storage system, be respectively Pending queue, Done queue and Sync queue;
When often receiving a write order, this write order is joined in Pending queue;
For each write order in Pending queue, when first predetermined condition, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue;
When each second predetermined condition, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively;
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
2. method according to claim 1, is characterized in that,
Described when each second predetermined condition, all write orders in Done queue are all transferred to Sync queue and comprises:
When the write order quantity in Done queue reaches predetermined threshold at every turn, or, often after scheduled duration, then all write orders in Done queue are all transferred in Sync queue.
3. method according to claim 1, is characterized in that,
Described all write orders corresponding with this disk in Sync queue are all deleted after, comprise further: discharge the internal memory shared by write order deleted.
4. the method according to claim 1 or 3, is characterized in that,
The method comprises further:
When storage system power down, all write orders in Pending queue, Done queue and Sync queue are all saved in system disk;
When storage system powers on, take out all write orders be kept in system disk, and all write orders taken out all are joined in Pending queue.
5. open a device for disk write cache, it is characterized in that, comprising:
First processing module, for setting up 3 queues within the storage system, is respectively Pending queue, Done queue and Sync queue;
Second processing module, for when often receiving a write order, joins this write order in Pending queue;
For each write order in Pending queue, when first predetermined condition, this write order is issued in corresponding disk, and when receiving the processing response that disk returns, this write order is transferred to Done queue from Pending queue;
When each second predetermined condition, all write orders in Done queue are all transferred in Sync queue, and for the disk corresponding to all write orders in Sync queue, perform sync order respectively;
When receiving the sync response that arbitrary disk returns, all write orders corresponding with this disk in Sync queue are all deleted.
6. device according to claim 5, is characterized in that,
When the write order quantity in Done queue reaches predetermined threshold at every turn, or often after scheduled duration, all write orders in Done queue are then all transferred in Sync queue by described second processing module.
7. device according to claim 5, is characterized in that,
Described second processing module is further used for, and after all being deleted by all write orders corresponding with this disk in Sync queue, discharges the internal memory shared by write order deleted.
8. the device according to claim 5 or 7, is characterized in that,
This device comprises further:
All write orders in Pending queue, Done queue and Sync queue, for when storage system power down, are all saved in system disk by the 3rd processing module;
When storage system powers on, take out all write orders be kept in system disk, and all write orders taken out all are joined in Pending queue.
CN201310438672.6A 2013-09-24 2013-09-24 A kind of method and apparatus opening disk write cache Active CN103514109B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310438672.6A CN103514109B (en) 2013-09-24 2013-09-24 A kind of method and apparatus opening disk write cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310438672.6A CN103514109B (en) 2013-09-24 2013-09-24 A kind of method and apparatus opening disk write cache

Publications (2)

Publication Number Publication Date
CN103514109A CN103514109A (en) 2014-01-15
CN103514109B true CN103514109B (en) 2016-04-13

Family

ID=49896861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310438672.6A Active CN103514109B (en) 2013-09-24 2013-09-24 A kind of method and apparatus opening disk write cache

Country Status (1)

Country Link
CN (1) CN103514109B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6446105B1 (en) * 1998-06-18 2002-09-03 Nec Corporation Method and medium for operating a vector computer
CN102231137A (en) * 2011-05-26 2011-11-02 浪潮(北京)电子信息产业有限公司 Data memory system and method
CN103019962A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Data cache processing method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6446105B1 (en) * 1998-06-18 2002-09-03 Nec Corporation Method and medium for operating a vector computer
CN102231137A (en) * 2011-05-26 2011-11-02 浪潮(北京)电子信息产业有限公司 Data memory system and method
CN103019962A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Data cache processing method, device and system

Also Published As

Publication number Publication date
CN103514109A (en) 2014-01-15

Similar Documents

Publication Publication Date Title
US20140208328A1 (en) Method for terminal acceleration, terminal and storage medium
US9323664B2 (en) Techniques for identifying read/write access collisions for a storage medium
WO2006006084A8 (en) Establishing command order in an out of order dma command queue
CN104657366B (en) The method, apparatus and log disaster tolerance system of massive logs write-in database
WO2007087507A3 (en) Firmware socket module for fpga-based pipeline processing
WO2013016567A3 (en) System and method for virtual partition monitoring
CN103338125B (en) A kind of method of batch network device configuration
AU2017259930A1 (en) Method for integrating a further bus subscriber into a bus system, and bus system
US9223379B2 (en) Intelligent receive buffer management to optimize idle state residency
US20170235689A1 (en) Method, apparatus, communication equipment and storage media for determining link delay
KR102143089B1 (en) Generate clock gating enable
CN105677256A (en) Virtual disk system based on local caching and scheduling method
CN103257700A (en) Energy saving method and energy saving device for Android system
CN104536780A (en) Electronic game resource high-efficiency loading method and system
CN103514109B (en) A kind of method and apparatus opening disk write cache
CN110287023A (en) Message treatment method, device, computer equipment and readable storage medium storing program for executing
CN105988955B (en) SDIO equipment and its electronic device and data transmission method of application
CN106843748A (en) It is a kind of to improve the method and system that data write movable storage device speed
CN106411718B (en) Data synchronization method and device based on instant messaging application
CN104424142A (en) Method and device for accessing shared resource in multi-core processor system
CN110569038B (en) Random verification parameter design method, device, computer equipment and storage medium
CN102750342B (en) A kind of method of cluster file system data consistency
CN102387029B (en) System and method for automatically saving equipment configuration information
CN103019865A (en) Virtual machine monitoring method and system
US9483401B2 (en) Data processing method and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: Room 505, Taixing Building, 11 Garden East Road, Haidian District, Beijing, 100191

Co-patentee after: Shenzhen Innovation Software Technology Co., Ltd.

Patentee after: Innovation Technology Co., Ltd.

Address before: Room 0801-0810, 51 College Road, Haidian District, Beijing, 100191

Co-patentee before: Chuangxinke Software Technology (Shenzhen) Co., Ltd.

Patentee before: Innovation and Technology Storage Technology Co., Ltd.

CP03 Change of name, title or address