All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
@ 2012-02-22  1:03 Jongman Heo
  2012-02-23 10:42 ` Francois Romieu
  0 siblings, 1 reply; 8+ messages in thread
From: Jongman Heo @ 2012-02-22  1:03 UTC (permalink / raw)
  To: Francois Romieu, netdev

> Sender : Francois Romieu<romieu@fr.zoreil.com>
> Date : 2012-02-21 18:56 (GMT+09:00)
> Title : Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
> 
> Jongman Heo :
> [...]
> > Host : windows 7 32bit
> > VMWare Guest : Fedora 16, with latest linus git kernel (3.3.0-rc4+). 
> >                         vmxnet3 ethernet driver, running NFS server
> 
> This is a 32bit HIGHMEM kernel, right ?

Right, 32bit HIGHMEM is set.

> 
> > Following warning triggered with my VMware Linux guest, when NFS connection is requested from outside.
> 
> I'd try reverting 39d4a96fd7d2926e46151adbd18b810aeeea8ec0.
> 
> -- 
> Ueimor

I confirm that reverting the commit fixes the warning.

Regards,
Jongman.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-22  1:03 Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71() Jongman Heo
@ 2012-02-23 10:42 ` Francois Romieu
  2012-02-23 11:53   ` Eric Dumazet
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Francois Romieu @ 2012-02-23 10:42 UTC (permalink / raw)
  To: Shreyas Bhatewara
  Cc: Jongman Heo, netdev, Scott J. Goldman, VMware PV-Drivers

(Heo, your mua broke threading)

Jongman Heo <jongman.heo@samsung.com> :
> Francois Romieu<romieu@fr.zoreil.com>
> > > Jongman Heo <jongman.heo@samsung.com> :
> > > Following warning triggered with my VMware Linux guest, when NFS connection is requested from outside.
> > 
> > I'd try reverting 39d4a96fd7d2926e46151adbd18b810aeeea8ec0.
[...]
> I confirm that reverting the commit fixes the warning.

Shreyas, can you provide a proper fix for this bug (see
http://www.spinics.net/lists/netdev/msg189554.html for details).

As far as I understand it you can not claim a fake transport layer header
size for udp and blindly check the available buffer size through
pskb_may_pull later. With a 32 bits HIGHMEM guest config (yuck...) it ends
up enabling bh within a network device start_xmit context.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 10:42 ` Francois Romieu
@ 2012-02-23 11:53   ` Eric Dumazet
  2012-02-23 13:22     ` Peter Zijlstra
  2012-02-23 20:08   ` David Miller
  2012-02-29  8:18   ` Shreyas Bhatewara
  2 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2012-02-23 11:53 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Shreyas Bhatewara, Jongman Heo, netdev, Scott J. Goldman,
	VMware PV-Drivers, Peter Zijlstra

Le jeudi 23 février 2012 à 11:42 +0100, Francois Romieu a écrit :
> (Heo, your mua broke threading)
> 
> Jongman Heo <jongman.heo@samsung.com> :
> > Francois Romieu<romieu@fr.zoreil.com>
> > > > Jongman Heo <jongman.heo@samsung.com> :
> > > > Following warning triggered with my VMware Linux guest, when NFS connection is requested from outside.
> > > 
> > > I'd try reverting 39d4a96fd7d2926e46151adbd18b810aeeea8ec0.
> [...]
> > I confirm that reverting the commit fixes the warning.
> 
> Shreyas, can you provide a proper fix for this bug (see
> http://www.spinics.net/lists/netdev/msg189554.html for details).
> 
> As far as I understand it you can not claim a fake transport layer header
> size for udp and blindly check the available buffer size through
> pskb_may_pull later. With a 32 bits HIGHMEM guest config (yuck...) it ends
> up enabling bh within a network device start_xmit context.
> 

Hmm, I am not sure we still need local_bh_disable()/local_bh_enable() in
kmap_skb_frag()/ kunmap_skb_frag() anymore after commit 3e4d3af501ccc
(mm: stack based kmap_atomic() )

diff --git a/net/core/kmap_skb.h b/net/core/kmap_skb.h
index 81e1ed7..06be5ee 100644
--- a/net/core/kmap_skb.h
+++ b/net/core/kmap_skb.h
@@ -2,18 +2,10 @@
 
 static inline void *kmap_skb_frag(const skb_frag_t *frag)
 {
-#ifdef CONFIG_HIGHMEM
-	BUG_ON(in_irq());
-
-	local_bh_disable();
-#endif
 	return kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ);
 }
 
 static inline void kunmap_skb_frag(void *vaddr)
 {
 	kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
-#ifdef CONFIG_HIGHMEM
-	local_bh_enable();
-#endif
 }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 11:53   ` Eric Dumazet
@ 2012-02-23 13:22     ` Peter Zijlstra
  2012-02-23 14:21       ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2012-02-23 13:22 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Francois Romieu, Shreyas Bhatewara, Jongman Heo, netdev,
	Scott J. Goldman, VMware PV-Drivers

On Thu, 2012-02-23 at 12:53 +0100, Eric Dumazet wrote:
> Hmm, I am not sure we still need local_bh_disable()/local_bh_enable() in
> kmap_skb_frag()/ kunmap_skb_frag() anymore after commit 3e4d3af501ccc
> (mm: stack based kmap_atomic() )

The only thing to consider is keeping the total stack size under
control, this is somewhat non-trivial since its non-obvious what all
nests.

That said, you're probably right, and we do have a WARN in there
(dependent on CONFIG_DEBUG_HIGHMEM) that yells if we exceed the
available stack size.

The more 'interesting' exercise is determining a better upper bound on
the stack size and updating kmap_types.h accordingly.

> diff --git a/net/core/kmap_skb.h b/net/core/kmap_skb.h
> index 81e1ed7..06be5ee 100644
> --- a/net/core/kmap_skb.h
> +++ b/net/core/kmap_skb.h
> @@ -2,18 +2,10 @@
>  
>  static inline void *kmap_skb_frag(const skb_frag_t *frag)
>  {
> -#ifdef CONFIG_HIGHMEM
> -       BUG_ON(in_irq());
> -
> -       local_bh_disable();
> -#endif
>         return kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ);
>  }
>  
>  static inline void kunmap_skb_frag(void *vaddr)
>  {
>         kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
> -#ifdef CONFIG_HIGHMEM
> -       local_bh_enable();
> -#endif
>  } 

The nicer patch would of course be a patch that does:

 s/kunmap_skb_frag/kunmap_atomic/
 s/kmap_skb_frag(\([^)]*\))/kmap_atomic(skb_frag_page(\1))/

There is no need to retain the KM_* argument and the 'helper' functions
are quite pointless at that point.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 13:22     ` Peter Zijlstra
@ 2012-02-23 14:21       ` Eric Dumazet
  2012-02-23 15:30         ` Peter Zijlstra
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2012-02-23 14:21 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Francois Romieu, Shreyas Bhatewara, Jongman Heo, netdev,
	Scott J. Goldman, VMware PV-Drivers

Le jeudi 23 février 2012 à 14:22 +0100, Peter Zijlstra a écrit :
> On Thu, 2012-02-23 at 12:53 +0100, Eric Dumazet wrote:
> > Hmm, I am not sure we still need local_bh_disable()/local_bh_enable() in
> > kmap_skb_frag()/ kunmap_skb_frag() anymore after commit 3e4d3af501ccc
> > (mm: stack based kmap_atomic() )
> 
> The only thing to consider is keeping the total stack size under
> control, this is somewhat non-trivial since its non-obvious what all
> nests.
> 
> That said, you're probably right, and we do have a WARN in there
> (dependent on CONFIG_DEBUG_HIGHMEM) that yells if we exceed the
> available stack size.
> 
> The more 'interesting' exercise is determining a better upper bound on
> the stack size and updating kmap_types.h accordingly.
> 

I would say its the same logic than crypto : We might use at most two
contexts for SKB frags : USER or SOFTIRQ

We probably can remove KM_SKB_DATA_SOFTIRQ slot and use fact that this
kmap user can reuse existing USER/SOFTIRQ slots

> > diff --git a/net/core/kmap_skb.h b/net/core/kmap_skb.h
> > index 81e1ed7..06be5ee 100644
> > --- a/net/core/kmap_skb.h
> > +++ b/net/core/kmap_skb.h
> > @@ -2,18 +2,10 @@
> >  
> >  static inline void *kmap_skb_frag(const skb_frag_t *frag)
> >  {
> > -#ifdef CONFIG_HIGHMEM
> > -       BUG_ON(in_irq());
> > -
> > -       local_bh_disable();
> > -#endif
> >         return kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ);
> >  }
> >  
> >  static inline void kunmap_skb_frag(void *vaddr)
> >  {
> >         kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
> > -#ifdef CONFIG_HIGHMEM
> > -       local_bh_enable();
> > -#endif
> >  } 
> 
> The nicer patch would of course be a patch that does:
> 
>  s/kunmap_skb_frag/kunmap_atomic/
>  s/kmap_skb_frag(\([^)]*\))/kmap_atomic(skb_frag_page(\1))/
> 
> There is no need to retain the KM_* argument and the 'helper' functions
> are quite pointless at that point.
> 
> 

Well, definitely a cleanup is possible, but probably not suitable for
3.3 and stable kernels ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 14:21       ` Eric Dumazet
@ 2012-02-23 15:30         ` Peter Zijlstra
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Zijlstra @ 2012-02-23 15:30 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Francois Romieu, Shreyas Bhatewara, Jongman Heo, netdev,
	Scott J. Goldman, VMware PV-Drivers

On Thu, 2012-02-23 at 15:21 +0100, Eric Dumazet wrote:
> Well, definitely a cleanup is possible, but probably not suitable for
> 3.3 and stable kernels ? 

Nah, that'd be better suited for a development branch like :-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 10:42 ` Francois Romieu
  2012-02-23 11:53   ` Eric Dumazet
@ 2012-02-23 20:08   ` David Miller
  2012-02-29  8:18   ` Shreyas Bhatewara
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2012-02-23 20:08 UTC (permalink / raw)
  To: romieu; +Cc: sbhatewara, jongman.heo, netdev, scottjg, pv-drivers

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 23 Feb 2012 11:42:37 +0100

> As far as I understand it you can not claim a fake transport layer header
> size for udp and blindly check the available buffer size through
> pskb_may_pull later. With a 32 bits HIGHMEM guest config (yuck...) it ends
> up enabling bh within a network device start_xmit context.

Right, lying about the transport header size is going to give you nothing
but trouble, you absolutely cannot do this or networking breaks, and your
transmit handler doesn't run in a context where you can legally "fix"
things up.

We recently fixed even IPoIB in this regard.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71()
  2012-02-23 10:42 ` Francois Romieu
  2012-02-23 11:53   ` Eric Dumazet
  2012-02-23 20:08   ` David Miller
@ 2012-02-29  8:18   ` Shreyas Bhatewara
  2 siblings, 0 replies; 8+ messages in thread
From: Shreyas Bhatewara @ 2012-02-29  8:18 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Jongman Heo, netdev, Scott J. Goldman, VMware PV-Drivers



----- Original Message -----
> (Heo, your mua broke threading)
> 
> Jongman Heo <jongman.heo@samsung.com> :
> > Francois Romieu<romieu@fr.zoreil.com>
> > > > Jongman Heo <jongman.heo@samsung.com> :
> > > > Following warning triggered with my VMware Linux guest, when
> > > > NFS connection is requested from outside.
> > > 
> > > I'd try reverting 39d4a96fd7d2926e46151adbd18b810aeeea8ec0.
> [...]
> > I confirm that reverting the commit fixes the warning.
> 
> Shreyas, can you provide a proper fix for this bug (see
> http://www.spinics.net/lists/netdev/msg189554.html for details).
> 
> As far as I understand it you can not claim a fake transport layer
> header
> size for udp and blindly check the available buffer size through
> pskb_may_pull later. With a 32 bits HIGHMEM guest config (yuck...) it
> ends
> up enabling bh within a network device start_xmit context.
> 
> --
> Ueimor
> 

Just sent a patch to fix the transport header size.

Thanks.
Shreyas

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-29  8:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22  1:03 Re: WARNING: at kernel/softirq.c:159 _local_bh_enable_ip+0x35/0x71() Jongman Heo
2012-02-23 10:42 ` Francois Romieu
2012-02-23 11:53   ` Eric Dumazet
2012-02-23 13:22     ` Peter Zijlstra
2012-02-23 14:21       ` Eric Dumazet
2012-02-23 15:30         ` Peter Zijlstra
2012-02-23 20:08   ` David Miller
2012-02-29  8:18   ` Shreyas Bhatewara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.