Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jul 2019 15:04:57 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Konstantin Belousov <kib@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r350005 - head/sys/kern
Message-ID:  <d281e1dc-1931-20a5-9f41-7c1f66d4f667@FreeBSD.org>
In-Reply-To: <201907151918.x6FJIPFo077975@repo.freebsd.org>
References:  <201907151918.x6FJIPFo077975@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--f6QZTqCCbXLuni5AVFkOjVEZTlVP3gPEb
Content-Type: multipart/mixed; boundary="4O55uizLTPgHe81ycKPIhD8CUZvPh5ztB";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Konstantin Belousov <kib@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <d281e1dc-1931-20a5-9f41-7c1f66d4f667@FreeBSD.org>
Subject: Re: svn commit: r350005 - head/sys/kern
References: <201907151918.x6FJIPFo077975@repo.freebsd.org>
In-Reply-To: <201907151918.x6FJIPFo077975@repo.freebsd.org>

--4O55uizLTPgHe81ycKPIhD8CUZvPh5ztB
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 7/15/2019 12:18 PM, Konstantin Belousov wrote:
> Author: kib
> Date: Mon Jul 15 19:18:25 2019
> New Revision: 350005
> URL: https://svnweb.freebsd.org/changeset/base/350005
>=20
> Log:
>   In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on =
retry.
>  =20

Is this also needed in do_sem_wait()? A similar pattern seems to be there=
=2E

I ask because of what I referenced on IRC. I have some processes stuck
in here from a 10.4 jail.

> ~/git/poudriere # procstat -kk 1498
>   PID    TID COMM                TDNAME              KSTACK
>  1498 100710 python2.7           -                   mi_switch+0x174 sl=
eepq_switch+0x110 sleepq_catch_signals+0x417 sleepq_wait_sig+0xf _sleep+0=
x2d0 umtxq_sleep+0x153 do_sem_wait+0x42c __umtx_op_sem_wait+0x6e amd64_sy=
scall+0x2bb fast_syscall_common+0x101
>  1498 101575 python2.7           -                   mi_switch+0x174 sl=
eepq_switch+0x110 sleepq_catch_signals+0x417 sleepq_wait_sig+0xf _sleep+0=
x2d0 umtxq_sleep+0x153 do_sem_wait+0x42c __umtx_op_sem_wait+0x6e amd64_sy=
scall+0x2bb fast_syscall_common+0x101
>  1498 101657 python2.7           -                   <running>
=2E..
> ~/git/poudriere # procstat -kk 1498
>   PID    TID COMM                TDNAME              KSTACK
>  1498 100710 python2.7           -                   mi_switch+0x174 sl=
eepq_switch+0x110 sleepq_catch_signals+0x417 sleepq_wait_sig+0xf _sleep+0=
x2d0 umtxq_sleep+0x153 do_sem_wait+0x42c __umtx_op_sem_wait+0x6e amd64_sy=
scall+0x2bb fast_syscall_common+0x101
>  1498 101575 python2.7           -                   mi_switch+0x174 sl=
eepq_switch+0x110 sleepq_catch_signals+0x417 sleepq_wait_sig+0xf _sleep+0=
x2d0 umtxq_sleep+0x153 do_sem_wait+0x42c __umtx_op_sem_wait+0x6e amd64_sy=
scall+0x2bb fast_syscall_common+0x101
>  1498 101657 python2.7           -                   do_sem_wait+0x1b6 =
__umtx_op_sem_wait+0x6e amd64_syscall+0x2bb fast_syscall_common+0x101
=2E..
> ~/git/poudriere # procstat -kk 94392
>   PID    TID COMM                TDNAME              KSTACK
> 94392 101815 python2.7           -                   mi_switch+0x174 sl=
eepq_switch+0x110 sleepq_catch_signals+0x417 sleepq_wait_sig+0xf _sleep+0=
x2d0 umtxq_sleep+0x153 do_sem_wait+0x42c __umtx_op_sem_wait+0x6e amd64_sy=
scall+0x2bb fast_syscall_common+0x101
> 94392 101816 python2.7           -                   __mtx_lock_sleep+0=
x118 __mtx_lock_flags+0x102 _sleep+0x334 umtxq_busy+0xb7 do_sem_wait+0x16=
1 __umtx_op_sem_wait+0x6e amd64_syscall+0x2bb fast_syscall_common+0x101
> 94392 102076 python2.7           -                   __mtx_lock_flags+0=
x94 do_sem_wait+0x228 __umtx_op_sem_wait+0x6e amd64_syscall+0x2bb fast_sy=
scall_common+0x101




>   Reported by:	ler
>   Bisected and reviewed by:	markj
>   Sponsored by:	The FreeBSD Foundation
>   MFC after:	12 days
>=20
> Modified:
>   head/sys/kern/kern_umtx.c
>=20
> Modified: head/sys/kern/kern_umtx.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/kern/kern_umtx.c	Mon Jul 15 17:13:32 2019	(r350004)
> +++ head/sys/kern/kern_umtx.c	Mon Jul 15 19:18:25 2019	(r350005)
> @@ -3316,14 +3316,13 @@ do_sem2_wait(struct thread *td, struct _usem2 *=
sem, st
> =20
>  	uq =3D td->td_umtxq;
>  	flags =3D fuword32(&sem->_flags);
> -	error =3D umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key);=

> -	if (error !=3D 0)
> -		return (error);
> -
>  	if (timeout !=3D NULL)
>  		abs_timeout_init2(&timo, timeout);
> =20
>  again:
> +	error =3D umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key);=

> +	if (error !=3D 0)
> +		return (error);
>  	umtxq_lock(&uq->uq_key);
>  	umtxq_busy(&uq->uq_key);
>  	umtxq_insert(uq);
>=20


--=20
Regards,
Bryan Drewery


--4O55uizLTPgHe81ycKPIhD8CUZvPh5ztB--

--f6QZTqCCbXLuni5AVFkOjVEZTlVP3gPEb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAEBCgB9FiEE+Rc8ssOq6npcih8JNddxu25Gl88FAl1AvwpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY5
MTczQ0IyQzNBQUVBN0E1QzhBMUYwOTM1RDc3MUJCNkU0Njk3Q0YACgkQNddxu25G
l89LyQf+Kxbydl1qk2biypqhVIsZlNYcb87KKF8lSBM6ND4jVTLGdlOoiF5eAJvQ
5P46/s13v7PBNvI8ZOv3lf19vsHoDkp9npQQ6LjCzfAmv3Ic3C8dEa0CQ32obVC/
lfw2u9pw6yYq455RGLULW5ikdBwnU56RMGMKqDWOO/NHR6C0S0KII1Y9C2aVaUMc
1f4yujyUcl1q/CS9UakazBa+U4fpefeWEgsE+9x8/y8jKuZ7wC/1MQYbcfKyneCc
6qzUT+sbdAdpYGxBo8+pCRf5EbqaikbC7K73YHB1uJLbb+YoDeEferZAWGdfWgO4
WIYA6wDZbWnZ7z1QKTAY9VbYoCBmrw==
=QNR8
-----END PGP SIGNATURE-----

--f6QZTqCCbXLuni5AVFkOjVEZTlVP3gPEb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d281e1dc-1931-20a5-9f41-7c1f66d4f667>