Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2011 19:31:28 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r227394 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <20111109173128.GF50300@deviant.kiev.zoral.com.ua>
In-Reply-To: <201111091725.pA9HPhXh092218@svn.freebsd.org>
References:  <201111091725.pA9HPhXh092218@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--O5LZf7nZwJBw2QY0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 09, 2011 at 05:25:43PM +0000, Konstantin Belousov wrote:
> Author: kib
> Date: Wed Nov  9 17:25:43 2011
> New Revision: 227394
> URL: http://svn.freebsd.org/changeset/base/227394
>=20
> Log:
>   Stopped process may legitimately have some threads sleeping and not
>   suspended, if the sleep is uninterruptible.
Even more, stopped process might have some threads still running in the
kernel mode, or inhibited due to wait on blockable locks. I was unable
to design an expression that would assert that such thread will be stopped
at the kernel->user boundary.

The assertion itself is useful and catched several bugs, but theoretically
can cause false positives. If any report of the fired assert for kernel-mode
thread is provided, I will remove the assertions.

>  =20
>   Reported and tested by:	pho
>   MFC after:	1 week
>=20
> Modified:
>   head/sys/amd64/amd64/machdep.c
>   head/sys/i386/i386/machdep.c
>=20
> Modified: head/sys/amd64/amd64/machdep.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/amd64/amd64/machdep.c	Wed Nov  9 17:15:51 2011	(r227393)
> +++ head/sys/amd64/amd64/machdep.c	Wed Nov  9 17:25:43 2011	(r227394)
> @@ -2047,7 +2047,8 @@ int
>  fill_fpregs(struct thread *td, struct fpreg *fpregs)
>  {
> =20
> -	KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td),
> +	KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td) ||
> +	    (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)),
>  	    ("not suspended thread %p", td));
>  	fpugetregs(td);
>  	fill_fpregs_xmm(&td->td_pcb->pcb_user_save, fpregs);
>=20
> Modified: head/sys/i386/i386/machdep.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/i386/i386/machdep.c	Wed Nov  9 17:15:51 2011	(r227393)
> +++ head/sys/i386/i386/machdep.c	Wed Nov  9 17:25:43 2011	(r227394)
> @@ -3299,7 +3299,8 @@ int
>  fill_fpregs(struct thread *td, struct fpreg *fpregs)
>  {
> =20
> -	KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td),
> +	KASSERT(td =3D=3D curthread || TD_IS_SUSPENDED(td) ||
> +	    (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)),
>  	    ("not suspended thread %p", td));
>  #ifdef DEV_NPX
>  	npxgetregs(td);


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEUEARECAAYFAk66uPAACgkQC3+MBN1Mb4iVQgCgyNICrEdJebqo7MtFOXKdwuJ9
BZYAlRcKOW/R6XRZhWWBIhgLR743YUQ=
=NItd
-----END PGP SIGNATURE-----

--O5LZf7nZwJBw2QY0--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111109173128.GF50300>