lkml.org 
[lkml]   [2005]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] sched: unlocked context-switches
Ingo Molnar wrote:
> * Nick Piggin <nickpiggin@yahoo.com.au> wrote:
>
>

>>I did propose doing unconditionally unlocked switches a while back
>>when my patch first popped up - you were against it then, but I guess
>>you've had second thoughts?
>
>
> the reordering of switch_to() and the switch_mm()-related logic was that
> made it really worthwile and clean. I.e. we pick a task atomically, we
> switch stacks, and then we switch the MM. Note that this setup still
> leaves the possibility open to move the stack-switching back under the
> irq-disabled section in a natural way.
>

Yeah true. I didn't come up with code for you to look at at
that point anyway so you were obviously just speculating!

>
>>It does add an extra couple of stores to on_cpu, and a wmb() for
>>architectures that didn't previously need the unlocked switches. And
>>ia64 needs the extra interrupt disable / enable. Probably worth it?
>
>
> it also removes extra stores to rq->prev_mm and other stores. I havent
> measured any degradation on x86.
>

Yeah true, although that is just a single cacheline (which will be
hot for any context switch heavy workload).

On the other hand, I tried put oncpu near other fields that are
accessed during context switch, so maybe its not an issue.

> If the irq disable/enable becomes widespread i'll do another patch to
> push the irq-enabling into switch_to() so the arch can do the
> stack-switch first and then enable interrupts and do the rest - but i
> didnt want to complicate things unnecessarily for now.
>
>
>>Minor style request: I like that you're accessing ->on_cpu through
>>functions so the !SMP case doesn't clutter the code with ifdefs... but
>>can you do set_task_on_cpu(p) and clear_task_on_cpu(p) ?
>
>
> yeah, i thought about these two variants and went for set_task_on_cpu()
> so that it's less encapsulated (it's really just a conditional
> assignment) and that it parallels set_task_cpu() use. But no strong
> feelings either way. Anyway, lets try what we have now, i'll do the rest
> in deltas.
>

Sounds good.

--
SUSE Labs, Novell Inc.


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

\
 
 \ /
  Last update: 2005-04-09 09:16    [W:0.034 / U:2.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site