public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	linux-arch@vger.kernel.org
Subject: Re: [patch] sched: unlocked context-switches
Date: Sat, 9 Apr 2005 08:55:07 +0200	[thread overview]
Message-ID: <20050409065507.GA4866@elte.hu> (raw)
In-Reply-To: <42577602.8090507@yahoo.com.au>


* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> Well that does look like a pretty good cleanup. It certainly is the 
> final step in freeing complex architecture switching code from 
> entanglement with scheduler internal locking, and unifies the locking 
> scheme.
> 
> 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.

> 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.

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.

	Ingo

  reply	other threads:[~2005-04-09  6:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08 18:38 [patch] sched: unlocked context-switches Luck, Tony
2005-04-09  4:38 ` Ingo Molnar
2005-04-09  6:28   ` Nick Piggin
2005-04-09  6:55     ` Ingo Molnar [this message]
2005-04-09  7:11       ` Nick Piggin
2005-04-09  9:22   ` Benjamin Herrenschmidt
2005-04-09 22:46     ` David S. Miller
2005-04-10  7:23       ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2005-04-08 12:16 Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050409065507.GA4866@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox