Pavel Machek wrote: > > > > > > > I've seen similar bugs. If you hook something on schedule_tq and > > forget > > > to set current->need_resched, this is exactly what you get. > > > > > I'm running with a patch that printk's if cpu_idle() is called while a > > softirq is pending. > > If I access the floppy on my K6/200 every track triggers the check, and > > sometimes the console blanking code triggers it. > > Seems floppy and console is buggy, then. > No. The softirq implementation is buggy. I can trigger the problem with the TASKLET_HI (floppy), and both net rx and tx (ping -l) > > What about creating a special cpu_is_idle() function that the idle > > functions must call before sleeping? > > I'd say just fix all the bugs. > Ok, there are 2 bugs that are (afaics) impossible to fix without checking for pending softirq's in cpu_idle(): a) queue_task(my_task1, tq_immediate); mark_bh(); schedule(); ;within schedule: do_softirq() ;within my_task1: mark_bh(); ; bh returns, but do_softirq won't loop ; do_softirq returns. ; schedule() clears current->need_resched ; idle thread scheduled. --> idle can run although softirq's are pending I assume I trigger this race with the floppy driver. b) hw interrupt do_softirq within the net_rx handler: another hw interrupt, additional packets are queued do_softirq won't loop. returns to idle thread. --> packets delayed unnecessary. What about the attached patch? Obviously the other idle cpu must be converted to use the function as well. -- Manfred