I like. Very clean.
One question...
> rq = task_rq_lock(p, &flags);
> + if (p->state == TASK_UNINTERRUPTIBLE)
> + uninterruptible = 1;
> p->state = TASK_RUNNING;
> if (!p->array) {
> + if (uninterruptible)
> + rq->nr_uninterruptible--;
> activate_task(p, rq);
> if (p->prio < rq->curr->prio)
> resched_task(rq->curr);
Why only decrement nr_uninterruptible if it is not already on a
runqueue? I suspect because then you assume it is a spurious wakeup and
did not have a corresponding deactivate_task? Same reason we increment
nr_running in activate_task and not here, I suspect... makes sense.
One thought on a quick way to test if the new method is returning
accurate results would be to leave the current count_active_task code
and then add:
if (nr != (nr_running() + nr_uninterruptible()))
printk("Danger Will Robinson!\n");
but you probably already did something similar.
Robert Love
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/