svn commit: r303884 - stable/11/sys/kern

John Baldwin jhb at FreeBSD.org
Tue Aug 9 18:56:31 UTC 2016


Author: jhb
Date: Tue Aug  9 18:56:29 2016
New Revision: 303884
URL: https://svnweb.freebsd.org/changeset/base/303884

Log:
  MFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.
  
  If a thread is created bound to a cpuset it might already be bound before
  its very first timeslice, and td_lastcpu will be NOCPU in that case.
  
  Approved by:	re (gjb)

Modified:
  stable/11/sys/kern/sched_4bsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/sched_4bsd.c
==============================================================================
--- stable/11/sys/kern/sched_4bsd.c	Tue Aug  9 18:53:57 2016	(r303883)
+++ stable/11/sys/kern/sched_4bsd.c	Tue Aug  9 18:56:29 2016	(r303884)
@@ -1241,7 +1241,7 @@ sched_pickcpu(struct thread *td)
 
 	mtx_assert(&sched_lock, MA_OWNED);
 
-	if (THREAD_CAN_SCHED(td, td->td_lastcpu))
+	if (td->td_lastcpu != NOCPU && THREAD_CAN_SCHED(td, td->td_lastcpu))
 		best = td->td_lastcpu;
 	else
 		best = NOCPU;


More information about the svn-src-all mailing list