Subject: Re: SCHED_LOCK(9)?
To: Andrew Doran <ad@netbsd.org>
From: Oliver Gould <ogould@olix0r.net>
List: tech-kern
Date: 04/20/2007 23:26:36
--MGYHOYXEY6WxJCY8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2007-04-20 23:12 -0500, Andrew Doran wrote:
> On Fri, Apr 20, 2007 at 04:05:00PM -0400, Oliver Gould wrote:
>=20
> > Is SCHED_LOCK used anymore?=20
>=20
> Nope.

Okay- I see now.  newlock2 must have been a afairly recent change (now
that I think about it, I remember seeing that thread).

> What are you trying to lock?

kqemu_schedule() is more-or-less the old sys/kern/kern_synch.c:yield()-
except KQEMU wants to prioritize itself.  Eg:

  int
  kqemu_schedule(void)
  {
        struct lwp *l;
        int s;

        l =3D curlwp;

        s =3D SCHED_LOCK();
        l->l_priority =3D MAXPRI;
        l->l_stat =3D LSRUN;
        setrunqueue(l);
        l->l_proc->p_stats->p_ru.ru_nvcsw++;
        mi_switch(l, NULL);
        splx(s);

        return issignal(curlwp) !=3D 0;
  }


Will mimicking the new yield() work similarly?

  - Oliver

--MGYHOYXEY6WxJCY8
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)

iQEVAwUBRimEa/BcMTqzwkq9AQIargf/XnTggU9UEpE2ocNXaol5YzDzLJLl2IDm
T9A/ctxQ80YS0NSPtjpb/D7pR3C6rhoSQ4IRBTZQL8PJ2hkqDi2ew+GVINBcozzN
FFh+sEPUhkAobMJ4zdJ5TclnZ0M9t4HbVUt5csslr4SokHB7bpAtWvtkbh3lQMn8
hK/pTSD722c/7DXJQB+ENXPe4auVOGOZP8+Y49lkY/iCMDO6176qDDXeX1XmdbBO
IFTzkXMiWJuxtRnIAnznw6Srp/v6UjVqsRVb6tlOpOAbH1kW6KnbStjFdL4woRE3
zjxBMO36+jzV+M+5u3YALKIqm73YK1mktjuU5s8IakRYIgpjvHTKrg==
=m0HA
-----END PGP SIGNATURE-----

--MGYHOYXEY6WxJCY8--