Policies and mechanisms for the migrations of the stripes are separated, with various mechanisms for migrations provided by the low level TSS driver in the kernel. The policies are imposed over the TSS device, by separate user level programs, that run as daemons, with suitable permissions. These policy routines communicate with the low level mechanisms through the ioctl() calls.
The low level TSS device does take some policy decisions in extreme situations such as when there is no free stripe for a particular I/O operation. These policy decisions at the kernel level cannot be avoided, as there may be no policy running at the user level forcing the kernel to take the decisions.
The TSS device driver maintains temperature and access fields for each stripe. Temperature field accumulates the accesses over a period of time. Access field indicates whether the stripe has been accessed in the recent past. The aging is the process of increasing the temperature of all recently accessed stripes, depending on its access field. Uptodate field also indicates whether the stripe has been accessed in recent past and is used by degrade process which reduces the stripe temperature using exponential degradation. We need separate access and uptodate field, as the aging and degradation can happen at different frequencies. Temperature of a stripe is reset during the migration of that stripe.
Following are the different mechanisms provided by the TSS driver that can be used by policy routines.
It is important to note that the information provided by the kernel about the stripes in the above mechanisms are as of that particular instant and may not be true at a later point in time when the user level application may use the information. There is no lock held in the kernel across requests. This approach was chosen as the policy enforcement is more to optimize the performance and not a strict guideline.
The advantages of having the policies separate from the low level device driver are the following:
Following are the policies that were implemented on the TSS device:
This policy is simple to implement but has the disadvantage of being static. It does the migrations of the stripes based on temperature.