Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-08 Thread David Miller
From: Eric Dumazet [EMAIL PROTECTED] Date: Tue, 08 Jan 2008 08:53:10 +0100 It warns us because rt_cache_get_first() can returns with RCU_BH *acquired* or not. As Herbert mentioned that's a pretty often used paradigm called conditional locking. :-) -- To unsubscribe from this list: send the

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-08 Thread Jarek Poplawski
On 08-01-2008 08:53, Eric Dumazet wrote: David Miller a écrit : ... Furthermore, these: rcu_read_unlock_bh() rcu_read_lock_bh() sequences are at best funny looking. For other lock types we would look at this and ask Does this even accomplish anything reliably? Well, original

[IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Eric Dumazet
CHECK net/ipv4/route.c net/ipv4/route.c:298:2: warning: context imbalance in 'rt_cache_get_first' - wrong count at exit net/ipv4/route.c:307:3: warning: context imbalance in 'rt_cache_get_next' - unexpected unlock net/ipv4/route.c:346:3: warning: context imbalance in 'rt_cache_seq_stop' -

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Herbert Xu
Eric Dumazet [EMAIL PROTECTED] wrote: CHECK net/ipv4/route.c net/ipv4/route.c:298:2: warning: context imbalance in 'rt_cache_get_first' - wrong count at exit net/ipv4/route.c:307:3: warning: context imbalance in 'rt_cache_get_next' - unexpected unlock net/ipv4/route.c:346:3: warning:

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Eric Dumazet
On Mon, 07 Jan 2008 23:11:53 +1100 Herbert Xu [EMAIL PROTECTED] wrote: Eric Dumazet [EMAIL PROTECTED] wrote: CHECK net/ipv4/route.c net/ipv4/route.c:298:2: warning: context imbalance in 'rt_cache_get_first' - wrong count at exit net/ipv4/route.c:307:3: warning: context imbalance in

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Herbert Xu
On Mon, Jan 07, 2008 at 02:56:24PM +0100, Eric Dumazet wrote: AFAIK, this patch reduces complexity and text size. But if we had loads of empty hash buckets couldn't this potentially increase latency by disabling BH longer than before? Cheers, -- Visit Openswan at http://www.openswan.org/

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Eric Dumazet
Herbert Xu a écrit : On Mon, Jan 07, 2008 at 02:56:24PM +0100, Eric Dumazet wrote: AFAIK, this patch reduces complexity and text size. But if we had loads of empty hash buckets couldn't this potentially increase latency by disabling BH longer than before? Well, we call

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Herbert Xu
On Mon, Jan 07, 2008 at 09:46:45PM +0100, Eric Dumazet wrote: Well, we call rcu_read_unlock_bh()/rcu_read_lock_bh() for each bucket, empty or not, before and after patch, so we dont change latency. Oh I see. Your patch looks good then. But we still need a solution in general unless we're to

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread David Miller
From: Eric Dumazet [EMAIL PROTECTED] Date: Mon, 7 Jan 2008 12:01:17 +0100 CHECK net/ipv4/route.c net/ipv4/route.c:298:2: warning: context imbalance in 'rt_cache_get_first' - wrong count at exit net/ipv4/route.c:307:3: warning: context imbalance in 'rt_cache_get_next' - unexpected

Re: [IPV4] ROUTE: Avoid sparse warnings

2008-01-07 Thread Eric Dumazet
David Miller a écrit : From: Eric Dumazet [EMAIL PROTECTED] Date: Mon, 7 Jan 2008 12:01:17 +0100 CHECK net/ipv4/route.c net/ipv4/route.c:298:2: warning: context imbalance in 'rt_cache_get_first' - wrong count at exit net/ipv4/route.c:307:3: warning: context imbalance in