A dynamic cache-locking algorithm may determine the most frequently used
function(s) and the number of cache lines that should be locked into the
instruction cache embedded into a processor. By evaluating the dynamic
cache-locking algorithm, a determination may be made to lock an optimal
amount of functions that correspond to a given, limited amount of
instruction cache.