Re: 2.6.15-rc5-rt4: BUG: swapper:0 task might have lost apreemption check!

From: Steven Rostedt
Date: Fri Dec 23 2005 - 10:37:04 EST


On Thu, 2005-12-22 at 21:14 -0600, K.R. Foley wrote:
> Lee Revell wrote:
> > Got this on boot. Same .config as the last one I sent you.
> >
> > VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1
> > ide1: BM-DMA at 0xe008-0xe00f, BIOS settings: hdc:DMA, hdd:pio
> > Probing IDE interface ide1...
> > BUG: swapper:0 task might have lost a preemption check!
> > [<c010440c>] dump_stack+0x1c/0x20 (20)
> > [<c01166aa>] preempt_enable_no_resched+0x5a/0x60 (20)
> > [<c0100dd9>] cpu_idle+0x79/0xb0 (12)
> > [<c0100280>] _stext+0x40/0x50 (28)
> > [<c03078e6>] start_kernel+0x176/0x1d0 (20)
> > [<c0100199>] 0xc0100199 (1086889999)
> > ---------------------------
> > | preempt count: 00000000 ]
> > | 0-level deep critical section nesting:
> > ----------------------------------------
> >
> >


OK, I just found an SMP bug, and here's the patch. Maybe this will help
you kr. I'm currently running x86_64 SMP with 2.6.15-rc5-rt4 with this
and my softirq-no-hrtimers patch I sent earlier.

-- Steve

Index: linux-2.6.15-rc5-rt4/kernel/workqueue.c
===================================================================
--- linux-2.6.15-rc5-rt4.orig/kernel/workqueue.c 2005-12-23 10:23:25.000000000 -0500
+++ linux-2.6.15-rc5-rt4/kernel/workqueue.c 2005-12-23 10:25:21.000000000 -0500
@@ -370,10 +370,17 @@
void set_workqueue_thread_prio(struct workqueue_struct *wq, int cpu,
int policy, int rt_priority, int nice)
{
- struct task_struct *p = wq->cpu_wq[cpu].thread;
+ struct cpu_workqueue_struct *cwq;
+ struct task_struct *p;
struct sched_param param = { .sched_priority = rt_priority };
+ unsigned long flags;
int ret;

+ cwq = per_cpu_ptr(wq->cpu_wq, cpu);
+ spin_lock_irqsave(&cwq->lock, flags);
+ p = cwq->thread;
+ spin_unlock_irqrestore(&cwq->lock, flags);
+
set_user_nice(p, nice);
ret = sys_sched_setscheduler(p->pid, policy, &param);
if (ret)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/