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

Linus Torvalds
2009-01-06T18:29:55Z

On Tue, 6 Jan 2009, Steven Rostedt wrote:
>
> Caching the rq is an interesting idea. But since the rq struct is local to
> sched.c, what would be a good API to do this?

Just move the whole "spin_or_schedule()" into sched.c, and you're all
done.

Yeah, that requires having sched.c know a bit about mutex locking rules,
but the data structures are already exported in <linux/mutex.h>, and while
_normal_ code should never care or know exactly how it is used, I think
the scheduler might as well. Mutexes are clearly very much a scheduling
entity, so it's not too much of a break with internal knowledge.

Linus