[Click] Notifier::upstream_empty_signal is always active

Eddie Kohler kohler at cs.ucla.edu
Sun Jun 14 12:25:33 EDT 2009


Hi Ashish,

Some code might help give you better advice as your problem remains somewhat 
obscure.  Nevertheless, here's some advice.

Ashish Sharma wrote:
> Hi all,
> I am trying to write a modified scheduler (based on prioscheduler). The new
> scheduler maintains a list of permissible queues from which the scheduler
> can draw packets from. So if there are n input queues to the scheduler, at
> any point of time only a subset of the queues are "valid" and the scheduler
> must check only these queues to see if they have any packets to transmit.
> This subset of "valid" queues changes with time.
> 
> I am relying on the Notifier::upstream_empty_signal to check if the input
> queues are non-empty. But, it turns out that the signal is active most of
> the time and is only reset after the pull function is called which returns
> null in case of an empty queue.

The number of empty pull()s before the notifier is set to false is 
semi-configurable.  It is determined by the SLEEPINESS_TRIGGER constant in 
notifierqueue.hh, which defaults to 9.  So my first suggestion is to test 
whether your analysis is correct, by setting SLEEPINESS_TRIGGER to 1 and 
recompiling and rerunning.  That will go from 9 failed pull()s to 1 failed 
pull() until the notifier is set.  If the performance of your system improves 
then maybe that's enough.  (Perhaps this value should be configurable anyway.) 
  If you want not even one failed pull(), that will take some reorganization 
of the code to clear the notifier in a different place (this would be easy to do).

> Since the valid/invalid test is an expensive
> one, what I would like is for the Notifier signal to act like a test
> function, so I only perform the valid/invalid operation if a queue is
> non-empty. Further, in case the queue is not empty but belongs to the set of
> "invalid" queues, I do not want to put the packet back at the head of the
> queue (of which I cannot think of a simple way of doing from within the
> scheduler element).

More generally, it seems like you should make your valid/invalid check 
cheaper.  There are many possible ways to do this, including caching old 
values of the check and only updating the cache when necessary.

Eddie


> One solution is that I extend the Queue element to include a test function
> and along with the signal check the test function.
> 
> Is there a clean way to make the Notifier signal active only when the input
> queue is really non-empty and not a false alarm?
> 
> Thank you for your time. I would really appreciate any suggestions or
> thoughts.
> 
> Thanks
> Ashish
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list