Fine grained and safe cache clearing