mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <hawk@diku.dk>
To: Robert Olsson <Robert.Olsson@data.slu.se>
Cc: Jens Laas <jens.laas@data.slu.se>,
	Hans Liss <hans.liss@its.uu.se>,
	"David S. Miller" <davem@davemloft.net>,
	Stephen Hemminger <shemminger@osdl.org>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	Patrick McHardy <kaber@trash.net>,
	linux-kernel@vger.kernel.org, linux-net@vger.kernel.org
Subject: Re: BUG in FIB trie v.0.404 kernel 2.6.16
Date: Sun, 26 Mar 2006 14:20:56 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0603261415160.13351@ask.diku.dk> (raw)
In-Reply-To: <17446.27682.102290.341183@robur.slu.se>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1271 bytes --]



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
-------------------------------------------------------------------

[-- Attachment #2: fib_trie_GFP.patch --]
[-- Type: TEXT/PLAIN, Size: 2320 bytes --]

--- linux-2.6.16-orig/net/ipv4/fib_trie.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-test/net/ipv4/fib_trie.c	2006-03-26 13:36:31.000000000 +0200
@@ -50,7 +50,7 @@
  *		Patrick McHardy <kaber@trash.net>
  */
 
-#define VERSION "0.404"
+#define VERSION "0.405"
 
 #include <linux/config.h>
 #include <asm/uaccess.h>
@@ -334,9 +334,9 @@ static struct tnode *tnode_alloc(unsigne
 	struct page *pages;
 
 	if (size <= PAGE_SIZE)
-		return kcalloc(size, 1, GFP_KERNEL);
+		return kcalloc(size, 1, GFP_ATOMIC);
 
-	pages = alloc_pages(GFP_KERNEL|__GFP_ZERO, get_order(size));
+	pages = alloc_pages(GFP_ATOMIC|__GFP_ZERO, get_order(size));
 	if (!pages)
 		return NULL;
 
@@ -362,7 +362,7 @@ static inline void tnode_free(struct tno
 
 static struct leaf *leaf_new(void)
 {
-	struct leaf *l = kmalloc(sizeof(struct leaf),  GFP_KERNEL);
+	struct leaf *l = kmalloc(sizeof(struct leaf),  GFP_ATOMIC);
 	if (l) {
 		l->parent = T_LEAF;
 		INIT_HLIST_HEAD(&l->list);
@@ -372,7 +372,7 @@ static struct leaf *leaf_new(void)
 
 static struct leaf_info *leaf_info_new(int plen)
 {
-	struct leaf_info *li = kmalloc(sizeof(struct leaf_info),  GFP_KERNEL);
+	struct leaf_info *li = kmalloc(sizeof(struct leaf_info),  GFP_ATOMIC);
 	if (li) {
 		li->plen = plen;
 		INIT_LIST_HEAD(&li->falh);
@@ -1959,7 +1959,7 @@ struct fib_table * __init fib_hash_init(
 						  NULL, NULL);
 
 	tb = kmalloc(sizeof(struct fib_table) + sizeof(struct trie),
-		     GFP_KERNEL);
+		     GFP_ATOMIC);
 	if (tb == NULL)
 		return NULL;
 
@@ -2137,7 +2137,7 @@ static int fib_triestat_seq_show(struct 
 {
 	struct trie_stat *stat;
 
-	stat = kmalloc(sizeof(*stat), GFP_KERNEL);
+	stat = kmalloc(sizeof(*stat), GFP_ATOMIC);
 	if (!stat)
 		return -ENOMEM;
 
@@ -2336,7 +2336,7 @@ static int fib_trie_seq_open(struct inod
 {
 	struct seq_file *seq;
 	int rc = -ENOMEM;
-	struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_KERNEL);
+	struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_ATOMIC);
 
 	if (!s)
 		goto out;
@@ -2457,7 +2457,7 @@ static int fib_route_seq_open(struct ino
 {
 	struct seq_file *seq;
 	int rc = -ENOMEM;
-	struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_KERNEL);
+	struct fib_trie_iter *s = kmalloc(sizeof(*s), GFP_ATOMIC);
 
 	if (!s)
 		goto out;

      reply	other threads:[~2006-03-26 18:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25 22:14 Jesper Dangaard Brouer
2006-03-26 10:25 ` Robert Olsson
2006-03-26 12:20   ` Jesper Dangaard Brouer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0603261415160.13351@ask.diku.dk \
    --to=hawk@diku.dk \
    --cc=Robert.Olsson@data.slu.se \
    --cc=davem@davemloft.net \
    --cc=hans.liss@its.uu.se \
    --cc=jens.laas@data.slu.se \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®