[lkml]   [2002]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] BUG(): sched.c: Line 944

On Tue, 17 Sep 2002, Linus Torvalds wrote:

> void schedule(void)
> {
> BUG_ON(in_atomic());
> BUG_ON(current->state & TASK_ZOMBIE);
> do_schedule();
> }
> void exit_schedule(void)
> {
> BUG_ON(!(current->state & TASK_ZOMBIE));
> do_schedule();
> }

i'd rather do it the other way around - ie. do a:

if (unlikely(current->state == TASK_ZOMBIE)) {
... exit checks ...
} else {
... normal checks ...

this test is cheaper than a function call. I'd say the ZOMBIE check alone
is not significant enough to introduce a function split in the hotpath.
This check is also easier to remove later on.

TASK_ZOMBIE is only ever allowed to be set for exiting tasks. [and if
TASK_ZOMBIE handling is broken then it will trigger the normal atomic
tests so it's not like we are silently ignoring those errors.]


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.090 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site