Author: jhb
Date: Tue Aug  9 18:59:16 2016
New Revision: 303885
URL: https://svnweb.freebsd.org/changeset/base/303885

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.

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

Changes in other areas also in this revision:
Modified:
  stable/9/sys/kern/sched_4bsd.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/10/sys/kern/sched_4bsd.c
==============================================================================
--- stable/10/sys/kern/sched_4bsd.c     Tue Aug  9 18:56:29 2016        
(r303884)
+++ stable/10/sys/kern/sched_4bsd.c     Tue Aug  9 18:59:16 2016        
(r303885)
@@ -1235,7 +1235,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;
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to