Skip to content
  • Eric Dumazet's avatar
    [NET]: rt_check_expire() can take a long time, add a cond_resched() · d90bf5a9
    Eric Dumazet authored
    On commit 39c90ece
    
    :
    
    	[IPV4]: Convert rt_check_expire() from softirq processing to workqueue.
    
    we converted rt_check_expire() from softirq to workqueue, allowing the
    function to perform all work it was supposed to do.
    
    When the IP route cache is big, rt_check_expire() can take a long time
    to run.  (default settings : 20% of the hash table is scanned at each
    invocation)
    
    Adding cond_resched() helps giving cpu to higher priority tasks if
    necessary.
    
    Using a "if (need_resched())" test before calling "cond_resched();" is
    necessary to avoid spending too much time doing the resched check.
    (My tests gave a time reduction from 88 ms to 25 ms per
    rt_check_expire() run on my i686 test machine)
    
    Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d90bf5a9