Hi Nilay,

Yes, you could make such an optimization, but you want to be careful not to 
introduce starvation.  You want to make sure that newly arriving messages are 
not always prioritized over previously stalled messages.

Could you avoid looping through all message buffers by creating a list of ready 
messages and simply scanning that instead?  You still want to store the 
messages in the message buffers because they model the virtual channel storage. 
 However, the list can be what the wakeup function actually scans.

Does that make sense to you, or am I overlooking something?

Brad


> -----Original Message-----
> From: m5-dev-boun...@m5sim.org [mailto:m5-dev-boun...@m5sim.org]
> On Behalf Of Nilay Vaish
> Sent: Thursday, February 03, 2011 10:23 AM
> To: M5 Developer List
> Subject: Re: [m5-dev] PerfectSwitch
> 
> On Thu, 3 Feb 2011, Nilay Vaish wrote:
> 
> > I implemented this approach. But it did not improve the performance.
> > So I tried to explore what could be the cause. The function
> > PerfectSwitch::wakeup() contains three loops.
> >
> > loop on number of virtual networks
> >  loop on number of incoming links
> >    loop till all messages for this (link, network) have been routed
> >
> > I am working with an 8 processor mesh network and run
> > ruby_random_test.py for
> > 400,000 loads. About 11-12% of the time is taken by this function,
> > which is the highest amongst all the functions. I moved the third loop
> > to another function. I found that the wakeup function is itself called
> > about 76,000,000 times, number of messages processed is about
> > 81,000,000. Out of these about
> > 71,000,000 have destination count = 1. Surprisingly the inner loop,
> > that I had separated out as a function, was called 3,600,000,000
> > times. That is about 45 times per invocation of the wakeup function,
> > when each invocation of the wakeup function processes just about one
> message.
> >
> > When is the wakeup function called? Is it called in a periodic
> > fashion? Or when a message needs to routed? Is it possible that
> > instead of looking at all the virtual networks and links, we look at
> > only those that have messages that need routing?
> >
> 
> I found that wakeup is scheduled only when a message needs to be routed.
> This is done using the consumer pointer. So, we need to some how inform
> the switch when ever wake up event happens, following <link, network>s
> need to be looked at. But this would mean a change in the Consumer class
> and in the RubyEvent class. Should we add a new parameter to the
> scheduling function, which would be some information that the wakeup
> function receives?
> 
> --
> Nilay
> _______________________________________________
> m5-dev mailing list
> m5-dev@m5sim.org
> http://m5sim.org/mailman/listinfo/m5-dev


_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to