Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2016 18:59:16 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r303885 - in stable: 10/sys/kern 9/sys/kern
Message-ID:  <201608091859.u79IxGVO054648@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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