Re: [PATCH][RFC]: mutex: adaptive spin

From: Linus Torvalds
Date: Tue Jan 06 2009 - 11:12:43 EST




On Tue, 6 Jan 2009, Linus Torvalds wrote:
>
> The other way around, you mean: we spin until the owner is no longer
> holding a cpu.

Btw, I hate the name of the helper function for that. "task_is_current()"?
"current" means something totally different in the linux kernel: it means
that the task is _this_ task.

So the only sensible implementation of "task_is_current(task)" is to just
make it return "task == current", but that's obviously not what the
function wants to do.

So it should be renamed. Something like "task_is_oncpu()" or whatever.

I realize that the scheduler internally has that whole "rq->curr" thing,
but that's an internal scheduler thing, and should not be confused with
the overall kernel model of "current".

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/