comparch-security / FlexiCAS

A Flexible Cache Architectural Simulator
Other
11 stars 3 forks source link

Concurrent access to exactly the same block? #132

Open wsong83 opened 3 months ago

wsong83 commented 3 months ago

When multithread is enabled, how can we detect and avoid concurrent accesses to the same address? Especially when partitions are supported or dynamic remapping is supported? A cache block might be inserted to the partition already checked by the hit function, the dynamic relocation buffer, which leads to false negative. The cache block might be fetched and inserted duplicated!

wsong83 commented 3 months ago

So perhaps we do need to postpone releasing the locked cache set until all cache partitions, including the relocation buffer pool, are checked! This would cause extra conflict between transactions (so the relocation pool should be checked at the end rather than beginning to reduce its lock probability). Only hit() function needs to be protected.

wsong83 commented 1 month ago

This should not happen as no two transaction with the same prio can lock the same cache set at the same time. However, the hit() function should lock all partitions before giving up!