Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2011 17:25:43 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227394 - in head/sys: amd64/amd64 i386/i386
Message-ID:  <201111091725.pA9HPhXh092218@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Nov  9 17:25:43 2011
New Revision: 227394
URL: http://svn.freebsd.org/changeset/base/227394

Log:
  Stopped process may legitimately have some threads sleeping and not
  suspended, if the sleep is uninterruptible.
  
  Reported and tested by:	pho
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- 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)
 {
 
-	KASSERT(td == curthread || TD_IS_SUSPENDED(td),
+	KASSERT(td == 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);

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- 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)
 {
 
-	KASSERT(td == curthread || TD_IS_SUSPENDED(td),
+	KASSERT(td == curthread || TD_IS_SUSPENDED(td) ||
+	    (P_SHOULDSTOP(td->td_proc) && TD_IS_SLEEPING(td)),
 	    ("not suspended thread %p", td));
 #ifdef DEV_NPX
 	npxgetregs(td);



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