9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9fans@9fans.net
Subject: Re: [9fans] 9front pegs CPU on VMware
Date: Mon, 16 Dec 2013 11:17:00 +0100	[thread overview]
Message-ID: <32762b37691e254428ee1fd8ce6dac10@felloff.net> (raw)
In-Reply-To: <CABwHSOstQ8nust+=GxvCy8c-uOJuaa09SLdvhg_7vHRarZ0QnQ@mail.gmail.com>

the idlehands() on 9front is as follows:

/*
 *  put the processor in the halt state if we've no processes to run.
 *  an interrupt will get us going again.
 */
void
idlehands(void)
{
	extern int nrdy;

	if(conf.nmach == 1)
		halt();
	else if(m->cpuidcx & Monitor)
		mwait(&nrdy);
}

the reason for not just unconditionally calling halt() on a *multiprocessor*
is that this would keep the processor sleeping even when processes become
ready to be executed. there is currently no way for the first woken processor
to wakup another one other than the monitor/mwait mechanism; which for some
reason seems not to be emulated in that vmware fusion setup. one can run
aux/cpuid to see what processor features are supported.

yes, theres the HZ tick that should wake up the sleeping processor eventually,
but then it might be too late.

note, this only applies to *multiprocessor* systems. so when you setup your
vm with just a single cpu, it will not waste cycles spinning.

--
cinap



  parent reply	other threads:[~2013-12-16 10:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  1:49 Blake McBride
2013-12-16  1:52 ` erik quanstrom
2013-12-16  2:35   ` Blake McBride
2013-12-16  2:58     ` andrey mirtchovski
2013-12-16  3:05       ` Blake McBride
2013-12-16 10:17     ` cinap_lenrek [this message]
2013-12-16 14:57       ` Blake McBride
2013-12-16 15:34         ` erik quanstrom
2013-12-16 16:25           ` Matthew Veety
2013-12-16 16:59             ` erik quanstrom
2013-12-17 11:00           ` cinap_lenrek
2013-12-17 13:38             ` erik quanstrom
2013-12-17 14:14               ` erik quanstrom
2013-12-19  9:01             ` Gorka Guardiola Muzquiz
2013-12-19 14:16               ` Gorka Guardiola
2013-12-19 15:19               ` erik quanstrom
2013-12-19 15:57                 ` Gorka Guardiola
2013-12-19 16:15                   ` erik quanstrom

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=32762b37691e254428ee1fd8ce6dac10@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --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).