All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Zoltan Boszormenyi <zboszor@freemail.hu>
Cc: lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: kernel/softirq.c issues under 2.6.5
Date: Tue, 27 Apr 2004 13:25:56 +1000	[thread overview]
Message-ID: <1083036355.2150.10.camel@bach> (raw)
In-Reply-To: <408A48BB.9040804@freemail.hu>

On Sat, 2004-04-24 at 21:00, Zoltan Boszormenyi wrote:
> Hi,
> 
> > On Tue, 2004-04-20 at 17:58, Aivils wrote:
> >> Hi all!
> >> 
> >> 	My 2.6.5 will not start until i applay patch bellow:
...
> This changes caused that the linuxconsole.sf.net patch against
> newer kernels (>2.6.3) did not boot. The .config is
> from 2.6.6-rc2-mm1 + changes from linuxconsole.sf.net patch.
> Do you want the whole patch to investigate?

No, but the bug is probably that patch submitting a softirq before it's
initialized.  This patch should find it: look for the backtrace.

Name: Debug Too-Early Use of softirqs
Status: Untested

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .31025-linux-2.6.6-rc2-bk4/kernel/softirq.c .31025-linux-2.6.6-rc2-bk4.updated/kernel/softirq.c
--- .31025-linux-2.6.6-rc2-bk4/kernel/softirq.c	2004-04-22 08:04:01.000000000 +1000
+++ .31025-linux-2.6.6-rc2-bk4.updated/kernel/softirq.c	2004-04-27 13:21:57.000000000 +1000
@@ -190,14 +190,18 @@ struct tasklet_head
 
 /* Some compilers disobey section attribute on statics when not
    initialized -- RR */
-static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec) = { NULL };
-static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec) = { NULL };
+static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec) = { (void *)1 };
+static DEFINE_PER_CPU(struct tasklet_head, tasklet_hi_vec) = { (void *)1 };
 
 void fastcall __tasklet_schedule(struct tasklet_struct *t)
 {
 	unsigned long flags;
 
 	local_irq_save(flags);
+	if (__get_cpu_var(tasklet_vec).list == (void *)1) {
+		WARN_ON(1);
+		__get_cpu_var(tasklet_vec).list = NULL;
+	}
 	t->next = __get_cpu_var(tasklet_vec).list;
 	__get_cpu_var(tasklet_vec).list = t;
 	raise_softirq_irqoff(TASKLET_SOFTIRQ);
@@ -211,6 +215,10 @@ void fastcall __tasklet_hi_schedule(stru
 	unsigned long flags;
 
 	local_irq_save(flags);
+	if (__get_cpu_var(tasklet_hi_vec).list == (void *)1) {
+		WARN_ON(1);
+		__get_cpu_var(tasklet_hi_vec).list = NULL;
+	}
 	t->next = __get_cpu_var(tasklet_hi_vec).list;
 	__get_cpu_var(tasklet_hi_vec).list = t;
 	raise_softirq_irqoff(HI_SOFTIRQ);
@@ -423,8 +431,8 @@ static int __devinit cpu_callback(struct
 
 	switch (action) {
 	case CPU_UP_PREPARE:
-		BUG_ON(per_cpu(tasklet_vec, hotcpu).list);
-		BUG_ON(per_cpu(tasklet_hi_vec, hotcpu).list);
+		per_cpu(tasklet_vec, hotcpu).list = NULL;
+		per_cpu(tasklet_hi_vec, hotcpu).list = NULL;
 		p = kthread_create(ksoftirqd, hcpu, "ksoftirqd/%d", hotcpu);
 		if (IS_ERR(p)) {
 			printk("ksoftirqd for %i failed\n", hotcpu);

-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


  reply	other threads:[~2004-04-27  3:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-24 11:00 kernel/softirq.c issues under 2.6.5 Zoltan Boszormenyi
2004-04-27  3:25 ` Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-04-20  7:58 Aivils
2004-04-20 22:21 ` Rusty Russell

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=1083036355.2150.10.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zboszor@freemail.hu \
    /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.