Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2018 09:41:28 -0800
From:      Mark Millard <marklmi26-fbsd@yahoo.com>
To:        Don Lewis <truckman@FreeBSD.org>, FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Ryzen issues on FreeBSD ?
Message-ID:  <0641905F-6D9D-4157-9DCC-88A2EBCBB720@yahoo.com>

next in thread | raw e-mail | index | archive | help
Don Lewis truckman at FreeBSD.org wrote on
Sat Jan 27 08:23:27 UTC 2018 :

>   PID    TID COMM                TDNAME              CPU  PRI STATE   =
WCHAN   =20
> 90692 100801 python2.7           -                    -1  124 sleep   =
usem     =20
> 90692 100824 python2.7           -                    -1  124 sleep   =
usem     =20
. . .


# grep -r '"usem"' /usr/src/sys/
/usr/src/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c:	"usem", { true, =
true, true }, true, DBG_USTORM_ID,
/usr/src/sys/kern/kern_umtx.c:	error =3D umtxq_sleep(uq, "usem", =
timeout =3D=3D NULL ? NULL : &timo);
/usr/src/sys/kern/kern_umtx.c:	error =3D umtxq_sleep(uq, "usem", =
timeout =3D=3D NULL ? NULL : &timo);

/usr/src/sys/kern/kern_umtx.c has :

#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10)
static int
do_sem_wait(struct thread *td, struct _usem *sem, struct _umtx_time =
*timeout)
{
. . .
        error =3D umtxq_sleep(uq, "usem", timeout =3D=3D NULL ? NULL : =
&timo);
. . .
#endif
. . .
static int
do_sem2_wait(struct thread *td, struct _usem2 *sem, struct _umtx_time =
*timeout)
{
. . .
        error =3D umtxq_sleep(uq, "usem", timeout =3D=3D NULL ? NULL : =
&timo);
. . .


The comparison/contrast for:

> 90692 101629 python2.7           -                    -1  125 sleep   =
umtxn    =20



# grep -r '"umtxn"' /usr/src/sys/
/usr/src/sys/kern/kern_umtx.c:			error =3D =
umtxq_sleep(uq, "umtxn", timeout =3D=3D NULL ?

/usr/src/sys/kern/kern_umtx.c has:

static int
do_lock_normal(struct thread *td, struct umutex *m, uint32_t flags,
    struct _umtx_time *timeout, int mode)
{
. . .
                /*
                 * We set the contested bit, sleep. Otherwise the lock =
changed
                 * and we need to retry or we lost a race to the thread
                 * unlocking the umtx.
                 */
                umtxq_lock(&uq->uq_key);
                umtxq_unbusy(&uq->uq_key);
                if (old =3D=3D owner)
                        error =3D umtxq_sleep(uq, "umtxn", timeout =3D=3D =
NULL ?
                            NULL : &timo);
                umtxq_remove(uq);
                umtxq_unlock(&uq->uq_key);
                umtx_key_release(&uq->uq_key);
. . .

Both contexts are umtxq_sleep usage:

/*
 * Put thread into sleep state, before sleeping, check if
 * thread was removed from umtx queue.
 */
static inline int
umtxq_sleep(struct umtx_q *uq, const char *wmesg, struct abs_timeout =
*abstime)
. . .


Note: I'm guessing that /usr/src/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c
is not involved.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( markmi at dsl-only.net is
going away in 2018-Feb, late)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0641905F-6D9D-4157-9DCC-88A2EBCBB720>