mem: Move eraseIfNullEntry to when holder is updated

The entry should only be tested for deletion when holder is updated.

Change-Id: I5a10b6fa876912709b7467860d43c23c60f38568
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19750
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel R. Carvalho
2019-06-21 16:24:28 +02:00
committed by Daniel Carvalho
parent 2f1a08240f
commit 334b8377f3

View File

@@ -206,9 +206,6 @@ SnoopFilter::lookupSnoop(const Packet* cpkt)
SnoopItem& sf_item = sf_it->second;
DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
SnoopMask interested = (sf_item.holder | sf_item.requested);
totSnoops++;
@@ -232,13 +229,14 @@ SnoopFilter::lookupSnoop(const Packet* cpkt)
// Early clear of the holder, if no other request is currently going on
// @todo: This should possibly be updated even though we do not filter
// upward snoops
DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
sf_item.holder = 0;
DPRINTF(SnoopFilter, "%s: new SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
eraseIfNullEntry(sf_it);
}
eraseIfNullEntry(sf_it);
DPRINTF(SnoopFilter, "%s: new SF value %x.%x interest: %x \n",
__func__, sf_item.requested, sf_item.holder, interested);
return snoopSelected(maskToPortList(interested), lookupLatency);
}
@@ -320,21 +318,20 @@ SnoopFilter::updateSnoopForward(const Packet* cpkt,
if (!is_hit)
return;
SnoopItem& sf_item = sf_it->second;
DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
// If the snoop response has no sharers the line is passed in
// Modified state, and we know that there are no other copies, or
// they will all be invalidated imminently
if (!cpkt->hasSharers()) {
sf_item.holder = 0;
}
DPRINTF(SnoopFilter, "%s: new SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
eraseIfNullEntry(sf_it);
SnoopItem& sf_item = sf_it->second;
DPRINTF(SnoopFilter, "%s: old SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
sf_item.holder = 0;
DPRINTF(SnoopFilter, "%s: new SF value %x.%x\n",
__func__, sf_item.requested, sf_item.holder);
eraseIfNullEntry(sf_it);
}
}
void