···1111The policy can return a simple HIT or MISS or issue a migration.12121313Currently there's no way for the policy to issue background work,1414-e.g. to start writing back dirty blocks that are going to be evicte1414+e.g. to start writing back dirty blocks that are going to be evicted1515soon.16161717Because we map bios, rather than requests it's easy for the policy···48484949The smq policy (vs mq) offers the promise of less memory utilization,5050improved performance and increased adaptability in the face of changing5151-workloads. SMQ also does not have any cumbersome tuning knobs.5151+workloads. smq also does not have any cumbersome tuning knobs.52525353Users may switch from "mq" to "smq" simply by appropriately reloading a5454DM table that is using the cache target. Doing so will cause all of the···5757that should be cached.58585959Memory usage:6060-The mq policy uses a lot of memory; 88 bytes per cache block on a 646060+The mq policy used a lot of memory; 88 bytes per cache block on a 646161bit machine.62626363-SMQ uses 28bit indexes to implement it's data structures rather than6363+smq uses 28bit indexes to implement it's data structures rather than6464pointers. It avoids storing an explicit hit count for each block. It6565-has a 'hotspot' queue rather than a pre cache which uses a quarter of6565+has a 'hotspot' queue, rather than a pre-cache, which uses a quarter of6666the entries (each hotspot block covers a larger area than a single6767cache block).68686969-All these mean smq uses ~25bytes per cache block. Still a lot of6969+All this means smq uses ~25bytes per cache block. Still a lot of7070memory, but a substantial improvement nontheless.71717272Level balancing:7373-MQ places entries in different levels of the multiqueue structures7474-based on their hit count (~ln(hit count)). This means the bottom7575-levels generally have the most entries, and the top ones have very7676-few. Having unbalanced levels like this reduces the efficacy of the7373+mq placed entries in different levels of the multiqueue structures7474+based on their hit count (~ln(hit count)). This meant the bottom7575+levels generally had the most entries, and the top ones had very7676+few. Having unbalanced levels like this reduced the efficacy of the7777multiqueue.78787979-SMQ does not maintain a hit count, instead it swaps hit entries with8080-the least recently used entry from the level above. The over all7979+smq does not maintain a hit count, instead it swaps hit entries with8080+the least recently used entry from the level above. The overall8181ordering being a side effect of this stochastic process. With this8282scheme we can decide how many entries occupy each multiqueue level,8383resulting in better promotion/demotion decisions.84848585Adaptability:8686-The MQ policy maintains a hit count for each cache block. For a8686+The mq policy maintained a hit count for each cache block. For a8787different block to get promoted to the cache it's hit count has to8888-exceed the lowest currently in the cache. This means it can take a8888+exceed the lowest currently in the cache. This meant it could take a8989long time for the cache to adapt between varying IO patterns.9090-Periodically degrading the hit counts could help with this, but I9191-haven't found a nice general solution.92909393-SMQ doesn't maintain hit counts, so a lot of this problem just goes9191+smq doesn't maintain hit counts, so a lot of this problem just goes9492away. In addition it tracks performance of the hotspot queue, which9593is used to decide which blocks to promote. If the hotspot queue is9694performing badly then it starts moving entries more quickly between9795levels. This lets it adapt to new IO patterns very quickly.98969997Performance:100100-Testing SMQ shows substantially better performance than MQ.9898+Testing smq shows substantially better performance than mq.10199102100cleaner103101-------