2006-03-25 22:14:15

by Jesper Dangaard Brouer

[permalink] [raw]
Subject: BUG in FIB trie v.0.404 kernel 2.6.16


BUG report for: FIB trie v.0.404
Kernel version: 2.6.16

When booting the kernel, the following debug output is printed. I assume
its a bug in the FIB trie code, as it is printed right after the fib tree
code is activated, and some of the functions refer to the trie code.

I have attached the .config file.


Syslog output while booting:
----------------------------
Linux version 2.6.16-orig (hawk@host) (gcc version 3.3.4) #1 SMP PREEMPT Sat Mar 25 22:26:15 CET 2006
...
IPv4 FIB: Using LC-trie version 0.404
Debug: sleeping function called from invalid context at mm/slab.c:2729
in_atomic():1, irqs_disabled():0
[<c0103c4e>] show_trace+0x20/0x24
[<c0103d70>] dump_stack+0x1e/0x22
[<c011db3d>] __might_sleep+0xa6/0xae
[<c0163675>] __kmalloc+0x8d/0x94
[<c015210b>] kzalloc+0x23/0x50
[<c0306391>] tnode_alloc+0x3c/0x82
[<c03064b6>] tnode_new+0x26/0x91
[<c03068f9>] inflate+0x43/0x51e
[<c03066d9>] resize+0xa1/0x27e
[<c0307361>] trie_rebalance+0x90/0x115
[<c0308118>] trie_leaf_remove+0x123/0x1c7
[<c03083e7>] fn_trie_delete+0x22b/0x28f
[<c030463f>] fib_magic+0xc9/0x117
[<c03049b8>] fib_del_ifaddr+0x1c0/0x1f4
[<c0304c04>] fib_inetaddr_event+0x2a/0x60
[<c012e432>] notifier_call_chain+0x27/0x3f
[<c02fc426>] inet_del_ifa+0xd1/0x21f
[<c02fd02a>] devinet_ioctl+0x4bf/0x591
[<c02ff061>] inet_ioctl+0x54/0x84
[<c02b08bb>] sock_ioctl+0xb4/0x24a
[<c01797e3>] do_ioctl+0x7b/0x8b
[<c0179986>] vfs_ioctl+0x62/0x1c1
[<c0179b26>] sys_ioctl+0x41/0x63
[<c0102e2d>] syscall_call+0x7/0xb


Greetings
Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
-------------------------------------------------------------------


Attachments:
config_kernel_2.6.16-orig (30.03 kB)

2006-03-26 10:27:39

by Robert Olsson

[permalink] [raw]
Subject: BUG in FIB trie v.0.404 kernel 2.6.16


Jesper Dangaard Brouer writes:

> BUG report for: FIB trie v.0.404
> Kernel version: 2.6.16
>
> When booting the kernel, the following debug output is printed. I assume
> its a bug in the FIB trie code, as it is printed right after the fib tree
> code is activated, and some of the functions refer to the trie code.

> Linux version 2.6.16-orig (hawk@host) (gcc version 3.3.4) #1 SMP PREEMPT Sat Mar 25 22:26:15 CET 2006
> ...
> IPv4 FIB: Using LC-trie version 0.404
> Debug: sleeping function called from invalid context at mm/slab.c:2729
> in_atomic():1, irqs_disabled():0
> [<c0103c4e>] show_trace+0x20/0x24

Hello!

I've have enabled debugging and was expecting to see this as well but I don't.
I'll assume this disapears if you change GFP_KERNEL to GFP_ATOMIC for tnode
and leaf allocations well replace throughout fib_trie.c

Cheers.
--ro

grep GFP /usr/src/git/new/net/ipv4/fib_trie.c
return kcalloc(size, 1, GFP_KERNEL);
pages = alloc_pages(GFP_KERNEL|__GFP_ZERO, get_order(size));
struct leaf *l = kmalloc(sizeof(struct leaf), GFP_KERNEL);
struct leaf_info *li = kmalloc(sizeof(struct leaf_info), GFP_KERNEL);
GFP_KERNEL);
stat = kmalloc(sizeof(*stat), GFP_KERNEL);
struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_KERNEL);
struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_KERNEL);

2006-03-26 18:48:49

by Jesper Dangaard Brouer

[permalink] [raw]
Subject: Re: BUG in FIB trie v.0.404 kernel 2.6.16



On Sun, 26 Mar 2006, Robert Olsson wrote:

> Jesper Dangaard Brouer writes:
>
> > BUG report for: FIB trie v.0.404
> > Kernel version: 2.6.16
> >
> > When booting the kernel, the following debug output is printed. I assume
> > its a bug in the FIB trie code, as it is printed right after the fib tree
> > code is activated, and some of the functions refer to the trie code.
>
> > Linux version 2.6.16-orig (hawk@host) (gcc version 3.3.4) #1 SMP PREEMPT Sat Mar 25 22:26:15 CET 2006
> > ...
> > IPv4 FIB: Using LC-trie version 0.404
> > Debug: sleeping function called from invalid context at mm/slab.c:2729
> > in_atomic():1, irqs_disabled():0
> > [<c0103c4e>] show_trace+0x20/0x24
>
> Hello!
>
> I've have enabled debugging and was expecting to see this as well but I don't.
> I'll assume this disapears if you change GFP_KERNEL to GFP_ATOMIC for tnode
> and leaf allocations well replace throughout fib_trie.c
>
> Cheers.
> --ro

I solved the problem! :-)
Have attached a patch with the changes I made.

See you around!
Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
-------------------------------------------------------------------


Attachments:
fib_trie_GFP.patch (2.27 kB)
fib_trie_GFP.patch