Eric Dumazet d90bf5a976 [NET]: rt_check_expire() can take a long time, add a cond_resched()
On commit 39c90ece7565f5c47110c2fa77409d7a9478bd5b:

	[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: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-14 16:14:05 -08:00
..
2007-11-12 21:25:24 -08:00
2007-11-02 08:47:06 +01:00
2007-10-19 11:53:41 -07:00
2007-10-26 04:06:08 -07:00
2007-10-14 12:41:52 -07:00
2007-10-15 12:26:35 -07:00
2007-10-15 12:26:35 -07:00
2007-10-20 01:34:40 +02:00
2007-04-25 22:28:20 -07:00
2007-10-10 16:48:31 -07:00