Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-17 Thread David Miller
From: Andi Kleen <[EMAIL PROTECTED]> Date: Sat, 17 Nov 2007 22:46:40 +0100 > > The 25.000.000 ns and 88.000.000 ns numbers where on an empty table, but > > large (16 MB of memory) > > This would mean that cond_resched() needs ~4x as much time as checking > an empty bucket. I find that somewhat h

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-17 Thread Andi Kleen
> The 25.000.000 ns and 88.000.000 ns numbers where on an empty table, but > large (16 MB of memory) This would mean that cond_resched() needs ~4x as much time as checking an empty bucket. I find that somewhat hard to believe. -Andi - To unsubscribe from this list: send the line "unsubscribe net

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-17 Thread Eric Dumazet
Andi Kleen a écrit : Eric Dumazet <[EMAIL PROTECTED]> writes: So it may sound unnecessary but in the rt_check_expire() case, with a loop potentially doing XXX.XXX iterations, being able to bypass the function call is a clear win (in my bench case, 25 ms instead of 88 ms). Impact on I-cache is i

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-17 Thread Andi Kleen
Eric Dumazet <[EMAIL PROTECTED]> writes: > So it may sound unnecessary but in the rt_check_expire() case, with a > loop potentially doing XXX.XXX iterations, being able to bypass the > function call is a clear win (in my bench case, 25 ms instead of 88 > ms). Impact on I-cache is irrelevant here a

Re: [NET]: rt_check_expire() can take a long time, add a cond_resched()

2007-11-15 Thread David Miller
From: Arjan van de Ven <[EMAIL PROTECTED]> Date: Thu, 15 Nov 2007 19:38:02 -0800 > On Thu, 15 Nov 2007 04:01:48 GMT > Linux Kernel Mailing List <[EMAIL PROTECTED]> wrote: > > > Using a "if (need_resched())" test before calling > > "cond_resched();" is necessary to avoid spending too much time

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-15 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Thu, 15 Nov 2007 09:25:59 +0100 > Please note that : > > if (need_resched()) > cond_resched(); > > will re-test need_resched() once cond_resched() is called. > > So it may sound unnecessary but in the rt_check_expire() case, with a loop > poten

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-15 Thread David Miller
From: Andi Kleen <[EMAIL PROTECTED]> Date: Thu, 15 Nov 2007 08:30:16 +0100 > Eric Dumazet <[EMAIL PROTECTED]> writes: > > > > Using a "if (need_resched())" test before calling "cond_resched();" is > > necessary to avoid spending too much time doing the resched check. > > The only difference betwe

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-15 Thread Eric Dumazet
Andi Kleen a écrit : Eric Dumazet <[EMAIL PROTECTED]> writes: Using a "if (need_resched())" test before calling "cond_resched();" is necessary to avoid spending too much time doing the resched check. The only difference between cond_resched() and if (need_resched()) cond_resched() is one funct

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-14 Thread Herbert Xu
Andi Kleen <[EMAIL PROTECTED]> wrote: > > A cheaper change might have been to just limit the number of buckets > scanned. Actually the whole point of moving it out to process context is so that we don't have to worry about keeping track of the number of buckets since deciding on how many buckets t

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-14 Thread Andi Kleen
Eric Dumazet <[EMAIL PROTECTED]> writes: > > Using a "if (need_resched())" test before calling "cond_resched();" is > necessary to avoid spending too much time doing the resched check. The only difference between cond_resched() and if (need_resched()) cond_resched() is one function call less and o

Re: [PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-14 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Wed, 14 Nov 2007 22:34:13 +0100 > On commit 39c90ece7565f5c47110c2fa77409d7a9478bd5b 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

[PATCH] NET : rt_check_expire() can take a long time, add a cond_resched()

2007-11-14 Thread Eric Dumazet
On commit 39c90ece7565f5c47110c2fa77409d7a9478bd5b 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