9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] why not halt in x86 multicore
Date: Fri,  1 Jul 2011 11:35:12 -0700	[thread overview]
Message-ID: <20110701183512.CFF4DB84F@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Fri, 01 Jul 2011 14:01:28 EDT." <bb78dd1fd32a508d375ac34343222402@ladd.quanstro.net>

On Fri, 01 Jul 2011 14:01:28 EDT erik quanstrom <quanstro@quanstro.net>  wrote:
> >
> > interprocessor interrupts are the obvious solution
> > but no one has bothered to implement them.
> >
>
> i almost mentioned this, and it's on my list.  i just haven't
> had the time.  it turns out that a naive implementation of
> ipi'ing 1 proc per wakeup will have to watch out for the
> same races that bedeviled multiprocessor sleep/wakeup.
>
> the really naive solution of waking 'em all up is a very
> bad idea because you'll have n-1 procs duking it out
> over the run queue.
>
> perhaps i just ignorant of the standard solution.
> or perhaps the sleep/wakeup model isn't the right one
> for the situation.

You might want to look at how FreeBSD does.
    http://fxr.watson.org/fxr/source/i386/i386/mp_machdep.c
    http://fxr.watson.org/fxr/source/i386/i386/machdep.c
Robert Watson's excellent site has cross-referenced sources
for a variety of OSes (including plan9) and releases for some
of them.

FreeBSD put in hlt for MP kernels in 2003 but the code has
evolved since then. The commit logs may be of some use too.
See the same files in http://www.freebsd.org/cgi/cvsweb.cgi



  reply	other threads:[~2011-07-01 18:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 14:00 Henning Schild
2011-07-01 17:23 ` erik quanstrom
2011-07-01 17:47   ` Ali Mashtizadeh
2011-07-01 17:51     ` Russ Cox
2011-07-01 18:01       ` erik quanstrom
2011-07-01 18:35         ` Bakul Shah [this message]
2011-07-02  5:06           ` Venkatesh Srinivas
2011-07-04  9:24   ` Henning Schild
2011-07-04  9:54     ` Sape Mullender
2011-07-04 13:02     ` erik quanstrom
2011-07-04 13:13       ` Steve Simon
2011-07-04 13:43         ` erik quanstrom
2011-07-04 13:47         ` Steve Simon

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=20110701183512.CFF4DB84F@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).