The present application claims the benefit under 35 U.S.C. ยง119(e) of Indian Application Serial Number 824/KOL/2013 filed Jul. 11, 2013. Said Indian Application Serial Number 824/KOL/2013 filed Jul. 11, 2013 is hereby incorporated by reference.
The present disclosure is directed generally towards caching of data and more particularly to systems and methods for maintaining a cache size proportional to power pack charge.
As cache memory is non-volatile, it requires a power pack such as a battery in order to offload the contents of the cache to a non-volatile memory during power loss. Failure to offload the contents of the controller cache to a non-volatile memory results in the loss of the data in the cache.
Therefore, there exists a need for improved methods and systems for maintaining cache size relative to power pack charge.
The present disclosure is directed to a method for managing a cache based on a charge of a power source. The method includes the step of determining a charge of the power source at a first time instance. The method also includes the step of designating for write back cache an amount of data in the cache which can be offloaded from the cache based on the charge of the power source at the first time instance. The method also includes the step of designating as write through cache an amount of data remaining in the cache which was not designated as write back cache.
Additional embodiments are described in the application including the claims. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive. Other embodiments of the invention will become apparent.
Other embodiments of the invention will become apparent by reference to the accompanying figures in which:
Reference will now be made in detail to the subject matter disclosed, which is illustrated in the accompanying drawings. The scope of embodiments of the invention is limited only by the claims; numerous alternatives, modifications, and equivalents are encompassed. For the purpose of clarity, technical material that is known in the technical fields related to the embodiments has not been described in detail to avoid unnecessarily obscuring the description.
As data stored in a cache memory is volatile, it requires a power pack such as a battery in order to offload the contents of the controller cache to a non-volatile memory during power loss. Failure to offload the contents of the controller cache to a non-volatile memory will result in the loss of the cache data which translates into data loss from the host system perspective.
The amount of battery charge required to maintain the data in the controller cache in write back mode depends on the time required to offload the data. The time required to offload the data depends on the amount of data in the controller cache. In some controllers, a fixed amount of write back cache is provided in case the power pack charge is not sufficient to offload the complete write back cache. Some systems set a minimum amount of power pack charge in order to support data in the cache being configured for write back cache. If the power pack is not charged to this minimum amount of charge, the cache policy for all of the data in the cache is designated as write through cache.
In general, this means the cache policy of all the data configured in write back mode will require a change in policy to write through mode when the power pack charge falls below the threshold. The cache policy is changed to write back once the battery is charged to the threshold. As the time required to charge the power pack is significant, overall system performance is impacted when the data is placed in write through mode during the charging period.
In one embodiment, the present disclosure provides a method where the write back cache size is made proportional to the battery capacity. The cache allocated for write back cache is flexible and increases as the battery charge increases, and decreases with decreases in battery charge.
In one embodiment, the designator module 102 is further configured for designating as write through cache a number of data segments 111 remaining in the cache 108 which are not designated as write back cache.
In one embodiment, the system 100 is configured to adjust the amount of write back cache when there is a change in the charge of the power source 110 exceeding a predetermined threshold. The control module 104 detects a change in the charge of the power source 110 exceeding the predetermined threshold and determines a number of data segments 111 which can be offloaded from the cache 108 based on the change in the charge of the power source 110. The designator module 102 is configured to either remove write back cache or write through cache, depending on whether the charge has increased or decreased. When the charge has increased, the designator module 102 is configured to remove the number of data segments 111 which can be offloaded from the cache 108 from the write through cache and add them to the write back cache. When the charge has decreased, the designator module 102 is configured to remove the number of data segments 111 which can be offloaded from the cache 108 from the write back cache and add them to the write through cache.
In one embodiment, the change exceeding a predetermined threshold in the charge of the power source 110 is equal to the amount of charge required to offload one data segment 111 from the cache 108. In another embodiment, the change exceeding a predetermined threshold in the charge of the power source 110 is either greater than or less than the amount of charge required to offload one data segment 111 from the cache 108.
In another embodiment, the system 100 is configured to adjust the amount of write back cache after a predetermined amount of time has elapsed. The control module 104 determines the charge of the power source 110 at a second time instance following the first time instance and determines a number of data segments 111 which can be offloaded from the cache 108 when the charge of the power source 110 at the second time instance has changed by an amount exceeding a predetermined threshold. When the charge has increased from the first time instance to the second time instance, the designator module 102 removes the number of data segments 111 which can be offloaded from the cache 108 from the write through cache and adds them to the write back cache. When the charge has decreased, the designator module 102 removes the number of data segments 111 which can be offloaded from the cache 108 from the write back cache and adds them to the write through cache.
The power source 110 of the system 100 is a back-up or secondary power source in one embodiment and is utilized when a primary power source fails. The power source 110 includes any suitable rechargeable battery or power pack in one embodiment.
In
In addition, the example provided in
Referring now to the embodiment provided in
In
In
In
In another embodiment, a method 900 for managing a cache is provided, as shown in
In one embodiment, the method 900 also includes the step of designating as write through cache a number of data segments remaining in the cache which are not designated as write back cache.
In one embodiment, the method 900 also includes the step of detecting a change in the charge of the power source exceeding a predetermined threshold and determining a number of data segments which can be offloaded from the cache based on the change in the charge of the power source. A further step of the method 900 also includes removing the number of data segments which can be offloaded from the cache based on the change in the charge of the power source from the write through cache and adding them to the write back cache when the charge has increased. The method 900 also includes the step of removing the number of data segments which can be offloaded from the cache based on the change in the charge of the power source from the write back cache and adding them to the write through cache when the charge has decreased.
In another embodiment, the method 900 includes the steps of determining a charge of the power source at a second time instance and determining a number of data segments which can be offloaded from the cache when the charge of the power source at the second time instance has changed by an amount exceeding a predetermined threshold. When the charge has increased from the first time instance to the second time instance, the method 900 includes the step of removing the number of data segments which can be offloaded from the cache based on the change in the charge of the power source from the write through cache and adding them to the write back cache. When the charge has decreased from the first time instance to the second time instance, the method 900 includes the step of removing the number of data segments which can be offloaded from the cache based on the change in the charge of the power source from the write back cache and adding them to the write through cache when the charge has decreased from the first time instance to the second time instance.
In another embodiment, the present disclosure is directed to a method 1000 for managing a cache based on a charge of a power source as shown in
In one embodiment, the method 1000 includes additional steps. For instance, a further step of the method 1000 includes detecting a change in the charge of the power source exceeding a predetermined threshold and determining an amount of data which can be offloaded from the cache based on the change in the charge of the power source. Yet another step of the method 1000 in one embodiment includes removing the amount of data which can be offloaded from the cache based on the change in the charge of the power source from the write through cache and adding the amount of data which can be offloaded from the cache based on the change in the charge of the power source to the write back cache when the charge has increased. If the charge has decreased, the data is removed from the write back cache and added to the write through cache.
The system and methods of the present disclosure support Input/Output capabilities, including instances when the power pack capacity is lower than the threshold to support complete DDR cache for write back policy. The system and methods of the present disclosure also assist with Input/output capabilities over time, including instances when the battery degrades over a period of time. The system and methods of the present disclosure support a flexible and adaptable cache memory size. The system and methods of the present disclosure support performance and assist with Input/output capabilities during times when the battery source is variable, including non-transparent power pack learn cycles in which the power unit gets discharged and charged again. The system and methods of the present disclosure also support cache offload even when partial DDR is used for write back cache.
In the present disclosure, the methods disclosed may be implemented as sets of instructions or software readable by a device. Further, it is understood that the specific order or hierarchy of steps in the methods disclosed are examples of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the method can be rearranged while remaining within the disclosed subject matter. The accompanying method claims present elements of the various steps in a sample order, and are not necessarily meant to be limited to the specific order or hierarchy presented.
It is believed that the present disclosure and many of its attendant advantages will be understood by the foregoing description, and it will be apparent that various changes may be made in the form, construction and arrangement of the components without departing from the disclosed subject matter or without sacrificing all of its material advantages. The form described is merely explanatory, and it is the intention of the following claims to encompass and include such changes.
Number | Date | Country | Kind |
---|---|---|---|
824KOL2013 | Jul 2013 | IN | national |