num_sets in cache_replacement_policy

25 views
Skip to first unread message

Artem Kulikov

unread,
Oct 8, 2025, 3:57:13 PM (8 days ago) Oct 8
to DynamoRIO Users
As I know, cache_size = line_size * associativity * num_sets. However, in the constructor for cache_replacement_policy_t, the number of sets is passed in as ache_size / cache_associativity. The tags and block IDs are calculated correctly, so access should be safe. The replacement_policy_test  covers only the policy itself, not the inner structure.

Could this be a bug, or have I misunderstood something?

Derek Bruening

unread,
Oct 9, 2025, 2:45:12 PM (7 days ago) Oct 9
to Artem Kulikov, DynamoRIO Users
This replacement policy was a recent refactoring. The size/assoc for TLB looks correct.  But at a glance, the cache ones using size/line_size look incorrect: I filed https://github.com/DynamoRIO/dynamorio/issues/7672 and notified the author.

On Wed, Oct 8, 2025 at 3:57 PM Artem Kulikov <kulikov...@gmail.com> wrote:
As I know, cache_size = line_size * associativity * num_sets. However, in the constructor for cache_replacement_policy_t, the number of sets is passed in as ache_size / cache_associativity. The tags and block IDs are calculated correctly, so access should be safe. The replacement_policy_test  covers only the policy itself, not the inner structure.

Could this be a bug, or have I misunderstood something?

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dynamorio-users/3d1fdcb5-ecb3-43ed-8c1f-978914417e9en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages