9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Yoann Padioleau <pad@fb.com>
To: Yoann Padioleau <pad@fb.com>
Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] bug in procwired() for x86 scheduler?
Date: Sun, 22 Jun 2014 22:25:29 +0000	[thread overview]
Message-ID: <1AE8E693-C840-4E40-BB19-6DF52A98E578@fb.com> (raw)
In-Reply-To: <EC073287-823A-4F0C-ACFD-2831DE775D53@fb.com>

The code should be

if(up != p && (p->wired == nil || p->wired == MACHP(m->machno))
   m->readied = p;

no?

> 
> if(up != p && (p->wired == nil || p->wired == m))
> 		m->readied = p;	/* group scheduling */

On Jun 22, 2014, at 10:20 AM, yoann padioleau <pad@fb.com> wrote:

> Hi,
> 
> Looking at the scheduler code I think I've found a bug related to the
> customized affinity one can set for a process.
> 
> In ready() there is:
> 
> 	if(up != p && (p->wired == nil || p->wired == m))
> 		m->readied = p;	/* group scheduling */
> 
> but on x86 'm' is actually set to a fixed address, MACHADDR. Each cpu actually
> have a different mapping in its pagetable to then translate MACHADDR virtual address to a different
> physical address.
> 
> in procwired() there is:
> 	p->wired = MACHP(bm);
> 
> MACHP is an array of addresses of all Mach in memory but not using this
> MACHADDR fixed virtual address. Each entry corresponds to a different Mach virtual
> address. 
> 
> So there is no way the test in ready() p->wired == m can even return true. 
> 




       reply	other threads:[~2014-06-22 22:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <EC073287-823A-4F0C-ACFD-2831DE775D53@fb.com>
2014-06-22 22:25 ` Yoann Padioleau [this message]
2014-06-22 23:20   ` cinap_lenrek
2014-06-22 23:25   ` Charles Forsyth
2014-06-23  0:57     ` erik quanstrom
2014-06-23  8:08       ` cinap_lenrek
2014-06-23 16:20       ` Yoann Padioleau
2014-06-23 16:39         ` 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=1AE8E693-C840-4E40-BB19-6DF52A98E578@fb.com \
    --to=pad@fb.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).