* Update idlers mask if necessary. When we're idling, other CPUs
* will tickle us when they get extra work.
*/
- if ( snext->pri == CSCHED_PRI_IDLE )
+ if ( !tasklet_work_scheduled && snext->pri == CSCHED_PRI_IDLE )
{
if ( !cpumask_test_cpu(cpu, prv->idlers) )
cpumask_set_cpu(cpu, prv->idlers);
}
else
{
- /* Update the idle mask if necessary */
- if ( !cpumask_test_cpu(cpu, &rqd->idle) )
+ /*
+ * Update the idle mask if necessary. Note that, if we're scheduling
+ * idle in order to carry on some tasklet work, we want to play busy!
+ */
+ if ( tasklet_work_scheduled )
+ {
+ if ( cpumask_test_cpu(cpu, &rqd->idle) )
+ cpumask_clear_cpu(cpu, &rqd->idle);
+ }
+ else if ( !cpumask_test_cpu(cpu, &rqd->idle) )
cpumask_set_cpu(cpu, &rqd->idle);
/* Make sure avgload gets updated periodically even
* if there's no activity */
/* No need to save IRQs here, they're already disabled */
spin_lock(&rqd->lock);
- BUG_ON(!cpumask_test_cpu(cpu, &rqd->idle));
-
printk("Removing cpu %d from runqueue %d\n", cpu, rqi);
cpumask_clear_cpu(cpu, &rqd->idle);