Messages in this thread | | | From | Nick Piggin <> | Subject | Re: runqueue locks in schedule() | Date | Fri, 18 Jan 2008 19:28:42 +1100 |
| |
On Friday 18 January 2008 17:33, stephane eranian wrote: > Nick,
> > It is arch specific. If an architecture wants interrupts on during > > context switch, or runqueue unlocked, then they set it (btw > > INTERRUPTS_ON_CTXSW also implies UNLOCKED_CTXSW). > > Yes , I noticed that. I am only interested in UNLOCKED_CTXSW. > But it appears that the approach suggested my Peter does work. We are > running some tests.
OK, that might be OK.
> > Although, eg on x86, you would hold off interrupts and runqueue lock for > > slightly less time if you defined those, it results in _slightly_ more > > complicated context switching... although I did once find a workload > > where the reduced runqueue contention improved throughput a bit, it is > > not much problem in general to hold the lock. > > By complicated you mean that now you'd have to make sure you don't > need to access runqueue data?
Well, not speaking about the arch-specific code (which may involve more complexities), but the core scheduler needs the task_struct->oncpu variable wheras that isn't required if the runqueue is locked while switching tasks.
| |