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 <p...@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 via email to