mem: Avoid unnecessary snoops on writebacks and clean evictions
authorAli Jafri <ali.jafri@arm.com>
Fri, 6 Nov 2015 08:26:40 +0000 (03:26 -0500)
committerAli Jafri <ali.jafri@arm.com>
Fri, 6 Nov 2015 08:26:40 +0000 (03:26 -0500)
This patch optimises the handling of writebacks and clean evictions
when using a snoop filter. Instead of snooping into the caches to
determine if the block is cached or not, simply set the status based
on the snoop-filter result.

src/mem/coherent_xbar.cc

index 223ab6ab5d0126a4d85e8b31df4726e3a1b3c68d..8407f53504839dfacf8455f60d523bf849bf9650 100644 (file)
@@ -198,7 +198,18 @@ CoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
                     " SF size: %i lat: %i\n", src_port->name(),
                     pkt->cmdString(), pkt->getAddr(), sf_res.first.size(),
                     sf_res.second);
-            forwardTiming(pkt, slave_port_id, sf_res.first);
+
+            if (pkt->evictingBlock()) {
+                // for block-evicting packets, i.e. writebacks and
+                // clean evictions, there is no need to snoop up, as
+                // all we do is determine if the block is cached or
+                // not, instead just set it here based on the snoop
+                // filter result
+                if (!sf_res.first.empty())
+                    pkt->setBlockCached();
+            } else {
+                forwardTiming(pkt, slave_port_id, sf_res.first);
+            }
         } else {
             forwardTiming(pkt, slave_port_id);
         }