ruby: consumer: move away from Consumer class
Review Request #2987 - Created July 23, 2015 and discarded
| Information | |
|---|---|
| Nilay Vaish | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11136:c4c3b2f0e36b --------------------------- ruby: consumer: move away from Consumer class Objects in ruby memory system typically inherit from the Consumer class that provides support for scheduling events. The Consumer class maintains a std::set of times at which events have been posted by the Derived class object. Typically this causes a lot of overhead. Secondly, the objects schedule events that are very coarse grained. This patch reduces ruby memory system's reliance on the Consumer class. The patch changes the objects in the Network and the generated code for Controllers in a significant way. The generated controllers would now schedule events for individual input ports and not for the entire controller itself. Similarly, PerfectSwitch and Throttle would now schedule events on individual message buffers and not for the entire object. This avoids looking at buffers that do not have any message pending.
Nice work tracking down 15-20% sim time! I WANT THAT!
It seems like this patch is trying to do a couple fairly orthogonal things: (1) improve performance by removing the Consumer class' scheduled event lookups and dynamically allocated events, and (2) move wakeup event scheduling responsibility from the Consumers into MessageBuffers. I really like the first aim, but I don't agree with the second. More below:
-
src/mem/ruby/common/Consumer.cc (Diff revision 1) -
Is the majority of the performance gain just from removing the alreadyScheduled() calls and dynamically allocated events? Or something else?
If the gain is from axing alreadyScheduled() and dynamic events, then that's all this patch should change.
-
src/mem/ruby/network/MessageBuffer.cc (Diff revision 1) -
Why does the MessageBuffer now have a pointer to the receiver's wakeupEvent?
I feel that it be the responsibility of the Consumer (receiver) to figure out when it will be able to pop something from the buffer. The MessageBuffer sorts its in-flight messages by time in order to signal to the receiver the first time at which the receiver is allowed to pop from the buffer. Seems like it would make more sense for the MessageBuffer to call a function on the receiver pointer to tell it when it can do so (e.g. scheduleEventAbsolute).
Thanks Nilay for sending out this patch to start the discussion. Unlike some of the other recent patches you posted, this one has obvious benefits and should not adversly impact too much downstream code. Having the Consumer class use AutoDelete Events was never meant to be the long-term solution. It was simply the easiest way for us to complete the initial merger of GEMS and M5. I'm glad to see this improvement.
So can you comment on whether you see this as an eventual set to eliminate the Consumer class?
-
src/mem/ruby/network/MessageBuffer.hh (Diff revision 1) -
Please use a longer name than em. This is not a local variable, but rather it is now a very important member for MessageBuffer. It deserves a more descriptive name and yes, I understand that there may be bad precedent in other parts of the code. For a variable as important this the EventManger, we should make sure it is easy to search for.
-
src/mem/ruby/network/garnet/fixed-pipeline/NetworkInterface_d.cc (Diff revision 1) -
Does this make sense to set the event manager but not set the event associated with the event manager? I probably do not fully appreciate the EventManager design, but I thought it existed just to make sure that a single event was only scheduled on a single event queue. It seems like the code requires the event to be set as well.
Perhaps this is why you say the patch is incomplete and that Garnet will not work.
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+15 -30) |
Summary: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+380 -333) |
Can anyone see the latest diff for this patch? At least for me I encounter the following error in both IE and Chrome:
The patch to 'src/mem/ruby/network/MessageBuffer.hh' didn't apply cleanly. The temporary files have been left in '/tmp/reviewboard.h2UJk2' for debugging purposes.
patchreturned:This may be a bug in the software, a temporary outage, or an issue with the format of your diff.Please try again, and if you still have trouble, contact support
