All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: Carson Gaspar <carson@taltos.org>,
	linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org,
	andrea@suse.de, davem@redhat.com
Subject: Re: kernel BUG at page_alloc.c:98 -- compiling with distcc
Date: Thu, 29 Apr 2004 18:09:51 -0300	[thread overview]
Message-ID: <20040429210951.GB20453@logos.cnet> (raw)
In-Reply-To: <16527.4259.174536.629347@segfault.boston.redhat.com>

On Tue, Apr 27, 2004 at 10:02:11PM -0400, Jeff Moyer wrote:
> 
> >FYI, we see the exact same panic with the tg3 driver using 2.4.25 and 
> >distcc with sendfile(). The bcm5700 driver also panics, but I haven't 
> >captured a panic message to be certain it's the same bug.
> 
> >kernel BUG at page_alloc.c:98!
> 
> Andrea fixed this in his tree by deferring the page free to process context
> instead of BUG()ing on PageLRU(page).

Yeap, his fix looks OK.

Can you please people seeing the oops try this, from Andrea (on top of 2.4.26):

--- a/mm/page_alloc.c.orig	2004-04-29 17:38:14.184021976 -0300
+++ b/mm/page_alloc.c	2004-04-29 17:47:27.906843312 -0300
@@ -46,6 +46,34 @@
 
 int vm_gfp_debug = 0;
 
+static void FASTCALL(__free_pages_ok (struct page *page, unsigned int order));
+
+static spinlock_t free_pages_ok_no_irq_lock = SPIN_LOCK_UNLOCKED;
+struct page * free_pages_ok_no_irq_head;
+
+static void do_free_pages_ok_no_irq(void * arg)
+{
+       struct page * page, * __page;
+
+       spin_lock_irq(&free_pages_ok_no_irq_lock);
+
+       page = free_pages_ok_no_irq_head;
+       free_pages_ok_no_irq_head = NULL;
+
+       spin_unlock_irq(&free_pages_ok_no_irq_lock);
+
+       while (page) {
+               __page = page;
+               page = page->next_hash;
+               __free_pages_ok(__page, __page->index);
+       }
+}
+
+static struct tq_struct free_pages_ok_no_irq_task = {
+       .routine        = do_free_pages_ok_no_irq,
+};
+
+
 /*
  * Temporary debugging check.
  */
@@ -81,7 +109,6 @@
  * -- wli
  */
 
-static void FASTCALL(__free_pages_ok (struct page *page, unsigned int order));
 static void __free_pages_ok (struct page *page, unsigned int order)
 {
 	unsigned long index, page_idx, mask, flags;
@@ -94,8 +121,20 @@
 	 * a reference to a page in order to pin it for io. -ben
 	 */
 	if (PageLRU(page)) {
-		if (unlikely(in_interrupt()))
-			BUG();
+		if (unlikely(in_interrupt())) {
+			unsigned long flags;
+
+			spin_lock_irqsave(&free_pages_ok_no_irq_lock, flags);
+			page->next_hash = free_pages_ok_no_irq_head;
+			free_pages_ok_no_irq_head = page;
+			page->index = order;
+	
+			spin_unlock_irqrestore(&free_pages_ok_no_irq_lock, flags);
+	
+			schedule_task(&free_pages_ok_no_irq_task);
+			return;
+		}
+		
 		lru_cache_del(page);
 	}
 

  reply	other threads:[~2004-04-29 21:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-23 22:33 kernel BUG at page_alloc.c:98 -- compiling with distcc Carson Gaspar
2004-04-28  2:02 ` Jeff Moyer
2004-04-29 21:09   ` Marcelo Tosatti [this message]
2004-04-29 21:28     ` Andrew Morton
2004-04-29 22:49       ` Andrea Arcangeli
2004-04-29 23:26         ` Andrew Morton
2004-04-30  0:15           ` Andrea Arcangeli
  -- strict thread matches above, loose matches on Subject: below --
2004-04-02 10:21 Marco Fais
2004-04-02 13:15 ` Marco Roeland
     [not found]   ` <6.0.0.22.2.20040402163334.02abe7d8@pop.localnet>
2004-04-02 15:05     ` Marco Roeland
2004-04-05 10:42       ` Marco Fais
2004-04-05 11:46         ` Marco Roeland
2004-04-05 14:08           ` Marco Fais
2004-04-05 14:36             ` Marco Roeland
2004-04-05 17:03       ` Max Valdez
2004-04-02 23:36 ` Andrew Morton
2004-04-05 10:47   ` Marco Fais
2004-04-05 10:56     ` Andrew Morton
2004-04-05 13:58       ` Marco Fais
2004-05-04  1:07 ` Marcelo Tosatti
2004-05-05 16:25   ` Carson Gaspar
2004-05-05 16:28     ` Marc-Christian Petersen
2004-05-05 18:35     ` Marcelo Tosatti
2004-05-19 11:59       ` Marcelo Tosatti
2004-05-19 15:50         ` Marc-Christian Petersen
2004-05-20 12:21           ` Marcelo Tosatti
2004-05-19 20:21         ` Carson Gaspar

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=20040429210951.GB20453@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=carson@taltos.org \
    --cc=davem@redhat.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /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 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.