mem: Do not use sender state to track forwarded snoops in cache
Review Request #3251 - Created Dec. 9, 2015 and submitted
Changeset 11277:b0171dac1864 --------------------------- mem: Do not use sender state to track forwarded snoops in cache This patch changes how the cache tracks which snoops are forwarded, and which ones are created locally. Previously the identification was based on an empty sender state of a specific class, but this method fails to distinguish which cache actually attached the sender state. Instead we use the same mechanism as the crossbar, and keep track of the requests that have outstanding snoops.
Doesn't the current mechanism work because a new ForwardResponseRecord would be created at each level of forwarding, and then peeled off at each level of response? Not saying this is robust, just curious if there's an actual bug here or just a concern.
Another alternative would be to add a cache pointer to ForwardResponseRecord, then the receiver can check/verify that the contained pointer points to 'this' before proceeding.
src/mem/cache/cache.cc (Diff revision 1)
how does this change relate to snoop forwarding?
Revision 2 (+23 -27)
Hey, I posted some comments but never gave this a ship it... I was going to say that neither solution (previous or current) seems all that great to me. Seems like if we really just want to know whether this request was issued by this cache or not, we ought to be able to do something straightforward like check req->masterId(), no?
Not that I'm a total purist or anything (and apparently I missed you doing the same trick elsewhere), but I'm not totally comfortable with using RequestPtr as a transaction ID or an STL set to model anything other than a fully associative hardware table.
FYI, the idea with SenderState is that it's really a shortcut for a master's outstanding transaction table, where normally you'd allocate a table entry and put a table index in the transaction as a tag, then do a table lookup based on that tag as a response. I thought this was discussed in the SenderState comment, but I see that it's not, unfortunately. The dynamic_cast is an abuse of this model as well, which is why I'm not defending the status quo here, just hoping that we can find a more straightforward replacement for it.