From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoann Padioleau To: Yoann Padioleau Date: Sun, 22 Jun 2014 22:25:29 +0000 Message-ID: <1AE8E693-C840-4E40-BB19-6DF52A98E578@fb.com> References: In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-ID: <568A5A1CE9C143428192EFF8A56BEFDC@fb.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] bug in procwired() for x86 scheduler? Topicbox-Message-UUID: fc8e88ce-ead8-11e9-9d60-3106f5b1d025 The code should be if(up !=3D p && (p->wired =3D=3D nil || p->wired =3D=3D MACHP(m->machno)) m->readied =3D p; no? >=20 > if(up !=3D p && (p->wired =3D=3D nil || p->wired =3D=3D m)) > m->readied =3D p; /* group scheduling */ On Jun 22, 2014, at 10:20 AM, yoann padioleau wrote: > Hi, >=20 > Looking at the scheduler code I think I've found a bug related to the > customized affinity one can set for a process. >=20 > In ready() there is: >=20 > if(up !=3D p && (p->wired =3D=3D nil || p->wired =3D=3D m)) > m->readied =3D p; /* group scheduling */ >=20 > but on x86 'm' is actually set to a fixed address, MACHADDR. Each cpu act= ually > have a different mapping in its pagetable to then translate MACHADDR virt= ual address to a different > physical address. >=20 > in procwired() there is: > p->wired =3D MACHP(bm); >=20 > 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 Mac= h virtual > address.=20 >=20 > So there is no way the test in ready() p->wired =3D=3D m can even return = true.=20 >=20