svn commit: r279356 - head/sys/kern

Andrew Turner andrew at FreeBSD.org
Fri Feb 27 12:38:25 UTC 2015


Author: andrew
Date: Fri Feb 27 12:38:24 2015
New Revision: 279356
URL: https://svnweb.freebsd.org/changeset/base/279356

Log:
  sched_random is only called for SMP, only define it there.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/sched_ule.c

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Fri Feb 27 12:23:30 2015	(r279355)
+++ head/sys/kern/sched_ule.c	Fri Feb 27 12:38:24 2015	(r279356)
@@ -302,7 +302,6 @@ static int sched_interact_score(struct t
 static void sched_interact_update(struct thread *);
 static void sched_interact_fork(struct thread *);
 static void sched_pctcpu_update(struct td_sched *, int);
-static int sched_random(void);
 
 /* Operations on per processor queues */
 static struct thread *tdq_choose(struct tdq *);
@@ -357,6 +356,7 @@ SDT_PROBE_DEFINE(sched, , , remain__cpu)
 SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", 
     "struct proc *");
 
+#ifdef SMP
 /*
  * We need some randomness. Implement the classic Linear Congruential
  * generator X_{n+1}=(aX_n+c) mod m. These values are optimized for
@@ -372,6 +372,7 @@ static int sched_random() 
         *rndptr = rnd;
         return(rnd);
 } 
+#endif
 
 /*
  * Print the threads waiting on a run-queue.


More information about the svn-src-all mailing list