• Anton Blanchard's avatar
    [PATCH] Speed up oprofile buffer drain code · bb795e33
    Anton Blanchard authored
    I noticed a large machine was doing about 400,000 context switches per
    second when oprofile was enabled.  Upon closer inspection it looks like we
    were rearming the buffer sync timer without modifying the expire time.
    
    Now that we have schedule_delayed_work_on I believe we can remove the timer
    completely.  Each cpu should be offset by 1 jiffy so they dont all fire at
    the same time.  I bumped DEFAULT_TIMER_EXPIRE from 2 to 10 times a second
    to be sure we reap cpu buffers.
    
    With the following patch the same large machine gets about 4000 context
    switches per second.
    Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    bb795e33
cpu_buffer.h 1.09 KB