That said, the exit() crap does end up being a bit unreadable. How about
just splitting up schedule() into the "normal schedule" and the "exit()"
case. In particular, there are a few other things that are illegal for
the non-exit case anyway, and that we migth as well check for. There are
also potentially things we might want to do in the exit case that we don't
want to do in the hot-path.
So we could just rename the current core "schedule()" functionality as
"static void do_schedule()", and then have
BUG_ON(current->state & TASK_ZOMBIE);
BUG_ON(!(current->state & TASK_ZOMBIE));
which is simpler than playing games with preempt_count == -2, and also
allows us more sanity checking than we have right now (the TASK_ZOMBIE
thing is also a exit-specific thing, and there may well be others too).
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/