Hello,

I have done some measurments using oprofile while running
loopback test for my comm driver.

Result 1.
         <cnt>     < % >
0001cc60 12931    3.95405     .text.lock.KBUILD_BASENAME       
00014d24 16618    5.08146     lis_atomic_read                  
0001c6f8 35473    10.847      lis_spin_lock_irqsave_fcn        
0001c750 36925    11.2909     lis_spin_unlock_irqrestore_fcn   
00014d4c 38526    11.7805%     lis_atomic_dec                   
00014d44 104768   32.036%      lis_atomic_inc 

I.e. lis_atomic_(inc/dec) chewed 44% of CPU while in streams module!!!

In order to see where those lis_atomic dudes are called from
I redifined them from functions to text definitions.
(Actually that is a beneficial thing on its own, 
lis_atomic_xxx() function calling just atomic_xxx() is a bit
of an overkill)

Result 2.

001c038 17193    3.00437     lis_rw_read_lock_irqsave_fcn  
0018388 19254    3.36451     LisUpCounter                  
001bd2c 22249    3.88787     lis_spin_lock_fcn             
001be7c 133388   23.3087     lis_spin_unlock_irqrestore_fcn
001be34 206767   36.1312     lis_spin_lock_irqsave_fcn

Now it spreaded to the lock functions.

So, I have commented out lis_atomic_inc(&lis_spin_lock_count) and

        if (spin_is_locked(l))                               
            lis_atomic_inc(&lis_spin_lock_contention_count) ;
from lis_spin_lock_irqsave_fcn() and couple of other functions.

I have also commented out statistic gathering from LisUpCounter()
that uses a bunch of atomic_xxx() calls.

Result 3.
         <cnt>      < % >
0001bcdc 20331    3.25159     lis_spin_lock_fcn             
0001bfb0 20438    3.2687      lis_rw_read_lock_irqsave_fcn  
0001bdf4 162768   26.0319     lis_spin_unlock_irqrestore_fcn
0001bdc8 168222   26.9042     lis_spin_lock_irqsave_fcn     

As it can be seen, that resulted in 10% saving for 
the lis_spin_lock_irqsave_fcn() execution.

Overall, I have added 7% to the idle time doing the same test.

Shouldn't it be beneficial to add #ifdef CONFIG_DEV
around statistic gathering in the aforementioned code places?

Replacing lis_atomic_xx() functions with text defs?


--
Eugene



__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams

Reply via email to