Research Article
MultiCache: Multilayered Cache Implementation for I/O Virtualization
Algorithm 1
MultiCache guest-level component.
() calculate the hash keys of and to retrieve their file metadata from the hash and history tables; | () if (not found) then insert their metadata to the hash table and the history table end if | () increase the usage counts of and by one; | () if (the usage count of ≥ USAGE_THRESHOLD) then | () if (∈read map and its position in read map is where ) then | () ++; move the metadata of from th position to th position of read map; | () else if (∈write map) then | () ++; move the metadata of to th position of read map; delete it from write map; | () else ++; insert the metadata of to th position of read map end if | () end if | () if (the usage count of ≥ USAGE_THRESHOLD) then | () if (∈write map and its position in write map is where ) then | () ++; move the metadata of from th position to th position of write map; | () else if (∈read map) then | () ++; move the metadata of to th position of write map; delete it from read map; | () else ++; insert the metadata of to th position of write map end if | () end if | () for each time epoch | () receive the current guest VM memory size from the resource monitor; | () check the condition specified in (1); | () if (the condition is not satisfied) then | () flush out files depicted in the section or until memory pressure is eliminated; | () end if | () end for |
|