Don Lewis truckman at FreeBSD.org wrote on
Sat Jan 27 08:23:27 UTC 2018 :
>   PID    TID COMM                TDNAME              CPU  PRI STATE   WCHAN
> 90692 100801 python2.7           -                    -1  124 sleep   usem
> 90692 100824 python2.7           -                    -1  124 sleep   usem
. . .
# 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 = umtxq_sleep(uq, "usem", timeout
== NULL ? NULL : &timo);
/usr/src/sys/kern/kern_umtx.c:	error = umtxq_sleep(uq, "usem", timeout
== 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 = umtxq_sleep(uq, "usem", timeout == NULL ? NULL :
&timo);
. . .
#endif
. . .
static int
do_sem2_wait(struct thread *td, struct _usem2 *sem, struct _umtx_time *timeout)
{
. . .
        error = umtxq_sleep(uq, "usem", timeout == NULL ? NULL :
&timo);
. . .
The comparison/contrast for:
> 90692 101629 python2.7           -                    -1  125 sleep   umtxn
# grep -r '"umtxn"' /usr/src/sys/
/usr/src/sys/kern/kern_umtx.c:			error = umtxq_sleep(uq, "umtxn",
timeout == 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 == owner)
                        error = umtxq_sleep(uq, "umtxn", timeout ==
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.
==Mark Millard
marklmi at yahoo.com
( markmi at dsl-only.net is
going away in 2018-Feb, late)