[Click] SimpleQueue and 100% CPU-load

Eddie Kohler kohler at cs.ucla.edu
Fri Jul 23 14:18:52 EDT 2004


Davy De Winter wrote:
> Hi,
> 
> when I loaded the following trivial click-configuration: 
> FromDevice(eth1) -> SimpleQueue(100) -> ToDevice(eth2); 
> the CPU-load is 99,x%. 

Yep.

> But when I load the following configuration:
> FromDevice(eth1) -> Queue(100) -> ToDevice(eth2)
> there's almost no CPU-load when no packets are sent. 

Yep.

> I first thought it was due to my implementation because I derived a new 
> Queue-class from SimpleQueue and not from NotifierQueue. 
> I also wrote another queue and there I also get this strange situation:
> when I commented the rule: ActiveNotifier::initialize(router) (from the 
> initialize()-method from the NotifierQueue) there was a load of 0%, but when 
> I loaded the queue with this rule uncommented, the load was again 99,x%.

You need to supply more information here, such as code.

> So I think it must be due to the Notifier-extensions on the queue. 
> Can somebody explain this "strange" situation, because as far as I can see, 
> the notifier has nothing to do with the real operation of the queue, but only 
> notifies changes in the empty-state to interested elements. 

It has to do with ToDevice.
If ToDevice sees a Notifier upstream, then it will go to sleep when no packets 
are available, and you'll see a load of 0%.  It can do this because the upstream 
Notifier -- here, NotifierQueue -- agrees to wake it up when a packet arrives.
If ToDevice does not see a Notifier upstream, then it will never go to sleep 
(because no one would agree to wake it up), so you'll see a load of 100%.

Eddie


More information about the click mailing list