From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yoann Padioleau To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Thu, 5 Jun 2014 00:56:22 +0000 Message-ID: <4836971E-CA9D-4282-BC5E-4596E0A3EB2B@fb.com> Content-Type: text/plain; charset="us-ascii" Content-ID: <689906B9FE27ED48A0189AB0DF667223@fb.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [9fans] minor kernel bug Topicbox-Message-UUID: f52bd9c4-ead8-11e9-9d60-3106f5b1d025 Hi, Here is a patch for tasklock.c: int lock(Lock *l) { int i; ulong pc; pc =3D getcallerpc(&l); lockstats.locks++; if(up) inccnt(&up->nlocks); /* prevent being scheded */ if(tas(&l->key) =3D=3D 0){ if(up) up->lastlock =3D l; l->pc =3D pc; l->p =3D up; l->isilock =3D 0; + l->m =3D MACHP(m->machno); ... return 0; } we do that in ilock() and canlock() so it's a bug I think to not do it also= in lock(). The field is only used in iprintcanlock which use canlock(), not lock(), so= this if fine, but for consistency it would be better to also do it in lock() no?