--- 2.6.17-rc3/kernel/sched.c.orig +++ 2.6.17-rc3/kernel/sched.c @@ -2904,10 +2904,28 @@ * Otherwise, whine if we are scheduling when we should not be. */ if (unlikely(in_atomic() && !current->exit_state)) { + /* Hack to avoid *serious* log-flooding. */ + static int skipped = -50; /* want to report the first 50 */ + static unsigned long last = 0; + int doprint = 1; + if (skipped < 0) { + if (!++skipped) + last = jiffies; + } else if (jiffies - last < 5 * HZ) /* should be 5s */ { + if (skipped < 0x7FFFFFFF) + ++skipped; + doprint = 0; + } + if (doprint) { + last = jiffies; + if (skipped) + printk(KERN_ERR "[%d s-w-a not reported]\n", skipped); + skipped = 0; printk(KERN_ERR "BUG: scheduling while atomic: " "%s/0x%08x/%d\n", current->comm, preempt_count(), current->pid); dump_stack(); + } } profile_hit(SCHED_PROFILING, __builtin_return_address(0));