From: Ingo Molnar <mingo@elte.hu>
To: Brent Casavant <bcasavan@sgi.com>
Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
jes@sgi.com, tony.luck@intel.com
Subject: Re: [PATCH] SN2 user-MMIO CPU migration
Date: Fri, 20 Jan 2006 09:36:51 +0100 [thread overview]
Message-ID: <20060120083651.GA3970@elte.hu> (raw)
In-Reply-To: <20060118163305.Y42462@chenjesu.americas.sgi.com>
* Brent Casavant <bcasavan@sgi.com> wrote:
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -291,6 +291,9 @@ for (domain = rcu_dereference(cpu_rq(cpu
> #ifndef finish_arch_switch
> # define finish_arch_switch(prev) do { } while (0)
> #endif
> +#ifndef arch_task_migrate
> +# define arch_task_migrate(task) do { } while (0)
> +#endif
> if (!p->array && !task_running(rq, p)) {
> + arch_task_migrate(p);
> set_task_cpu(p, dest_cpu);
> if (new_cpu != cpu) {
> + arch_task_migrate(p);
> set_task_cpu(p, new_cpu);
> dec_nr_running(p, src_rq);
> + arch_task_migrate(p);
> set_task_cpu(p, this_cpu);
> + arch_task_migrate(p);
> set_task_cpu(p, dest_cpu);
hm, why isnt the synchronization done in switch_to()? Your arch-level
switch_to() could have something like thread->last_cpu_sync, and if
thread->last_cpu_sync != this_cpu, do the flush. This would not only
keep this stuff out of the generic scheduler, but it would also optimize
things a bit more: the moment we do a set_task_cpu() it does not mean
that CPU _will_ run the task. Another CPU could grab that task later on.
So we should delay such IO-synchronization to the last possible moment:
when we know that we've hit a new CPU on which we havent done a flush
yet. For same-CPU context switches there wouldnt be any extra
synchronization, because thread->last_cpu_sync == this_cpu.
Ingo
next prev parent reply other threads:[~2006-01-20 8:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-20 0:06 [PATCH] SN2 user-MMIO CPU migration Brent Casavant
2006-01-20 2:18 ` Jesse Barnes
2006-01-20 6:47 ` Brent Casavant
2006-01-20 17:36 ` Jesse Barnes
2006-01-20 20:01 ` Brent Casavant
2006-01-20 13:26 ` Jack Steiner
2006-01-20 17:31 ` Jesse Barnes
2006-01-20 19:00 ` Jack Steiner
2006-01-20 8:36 ` Ingo Molnar [this message]
2006-01-20 16:14 ` Brent Casavant
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=20060120083651.GA3970@elte.hu \
--to=mingo@elte.hu \
--cc=bcasavan@sgi.com \
--cc=jes@sgi.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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