PERFORCE change 141630 for review
Julian Elischer
julian at FreeBSD.org
Thu May 15 05:59:51 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=141630
Change 141630 by julian at julian_trafmon1 on 2008/05/15 05:59:19
revert the sched_ule.c diffs for now
Affected files ...
.. //depot/projects/vimage/src/sys/kern/kern_vimage.c#58 edit
.. //depot/projects/vimage/src/sys/kern/sched_ule.c#22 edit
Differences ...
==== //depot/projects/vimage/src/sys/kern/kern_vimage.c#58 (text+ko) ====
@@ -909,8 +909,8 @@
panic("going nowhere without my vnet modules!");
}
-SYSINIT(vimage, SI_SUB_VIMAGE, SI_ORDER_FIRST, vi_init, NULL)
-SYSINIT(vimage_done, SI_SUB_VIMAGE_DONE, SI_ORDER_FIRST, vi_init_done, NULL)
+SYSINIT(vimage, SI_SUB_VIMAGE, SI_ORDER_FIRST, vi_init, NULL);
+SYSINIT(vimage_done, SI_SUB_VIMAGE_DONE, SI_ORDER_FIRST, vi_init_done, NULL);
#ifdef VI_PREALLOC_SIZE
void *
==== //depot/projects/vimage/src/sys/kern/sched_ule.c#22 (text+ko) ====
@@ -40,7 +40,6 @@
#include "opt_hwpmc_hooks.h"
#include "opt_sched.h"
-#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -61,7 +60,6 @@
#include <sys/umtx.h>
#include <sys/vmmeter.h>
#include <sys/cpuset.h>
-#include <sys/vimage.h>
#ifdef KTRACE
#include <sys/uio.h>
#include <sys/ktrace.h>
@@ -267,13 +265,8 @@
/* Operations on per processor queues */
static struct thread *tdq_choose(struct tdq *);
static void tdq_setup(struct tdq *);
-#ifndef VIMAGE
static void tdq_load_add(struct tdq *, struct thread *);
static void tdq_load_rem(struct tdq *, struct thread *);
-#else
-static void tdq_load_add(struct tdq *, struct thread *, struct vprocg *);
-static void tdq_load_rem(struct tdq *, struct thread *, struct vprocg *);
-#endif
static __inline void tdq_runq_add(struct tdq *, struct thread *, int);
static __inline void tdq_runq_rem(struct tdq *, struct thread *);
static inline int sched_shouldpreempt(int, int, int);
@@ -476,11 +469,7 @@
* for this thread to the referenced thread queue.
*/
static void
-#ifndef VIMAGE
tdq_load_add(struct tdq *tdq, struct thread *td)
-#else
-tdq_load_add(struct tdq *tdq, struct thread *td, struct vprocg *vprocg)
-#endif
{
TDQ_LOCK_ASSERT(tdq, MA_OWNED);
@@ -497,11 +486,7 @@
* exiting.
*/
static void
-#ifndef VIMAGE
tdq_load_rem(struct tdq *tdq, struct thread *td)
-#else
-tdq_load_rem(struct tdq *tdq, struct thread *td , struct vprocg *vprocg)
-#endif
{
THREAD_LOCK_ASSERT(td, MA_OWNED);
@@ -1291,11 +1276,7 @@
/* Add thread0's load since it's running. */
TDQ_LOCK(tdq);
thread0.td_lock = TDQ_LOCKPTR(TDQ_SELF());
-#ifndef VIMAGE
tdq_load_add(tdq, &thread0);
-#else
- tdq_load_add(tdq, &thread0, TD_TO_VPROCG(&thread0));
-#endif
tdq->tdq_lowpri = thread0.td_priority;
TDQ_UNLOCK(tdq);
}
@@ -1823,11 +1804,7 @@
/* This thread must be going to sleep. */
TDQ_LOCK(tdq);
mtx = thread_block_switch(td);
-#ifndef VIMAGE
tdq_load_rem(tdq, td);
-#else
- tdq_load_rem(tdq, td, TD_TO_VPROCG(td));
-#endif
}
/*
* We enter here with the thread blocked and assigned to the
@@ -2272,11 +2249,7 @@
if (td->td_priority < tdq->tdq_lowpri)
tdq->tdq_lowpri = td->td_priority;
tdq_runq_add(tdq, td, flags);
-#ifndef VIMAGE
tdq_load_add(tdq, td);
-#else
- tdq_load_add(tdq, td, TD_TO_VPROCG(td));
-#endif
}
/*
@@ -2345,11 +2318,7 @@
KASSERT(TD_ON_RUNQ(td),
("sched_rem: thread not on run queue"));
tdq_runq_rem(tdq, td);
-#ifndef VIMAGE
tdq_load_rem(tdq, td);
-#else
- tdq_load_rem(tdq, td, TD_TO_VPROCG(td));
-#endif
TD_SET_CAN_RUN(td);
if (td->td_priority == tdq->tdq_lowpri)
tdq_setlowpri(tdq, NULL);
@@ -2474,11 +2443,7 @@
* Return the total system load.
*/
int
-#ifdef VIMAGE
-sched_load(struct vprocg *vprocg)
-#else
sched_load(void)
-#endif
{
#ifdef SMP
int total;
@@ -2486,39 +2451,12 @@
total = 0;
for (i = 0; i <= mp_maxid; i++)
-#ifndef VIMAGE
total += TDQ_CPU(i)->tdq_sysload;
+ return (total);
#else
- total += V_tdq_sysload[i]; /* XXX JRE */
-#endif
- return (total);
-#else /* !SMP */
-#ifndef VIMAGE
return (TDQ_SELF()->tdq_sysload);
-#else
- return (V_tdq_sysload[0]);
-#endif
-#endif /* SMP */
-}
-
-#ifdef VIMAGE
-void
-sched_load_reassign(struct vprocg *old, struct vprocg *new)
-{
-#ifdef SMP
- int tdg_id;
-
- critical_enter();
- tdg_id = TDG_ID(tdq_cpu[curcpu].tdq_group);
- old->_tdq_sysload[tdg_id]--;
- new->_tdq_sysload[tdg_id]++;
- critical_exit();
-#else
- old->_tdq_sysload[0]--;
- new->_tdq_sysload[0]++;
#endif
}
-#endif
int
sched_sizeof_proc(void)
@@ -2601,11 +2539,7 @@
spinlock_exit();
} else {
MPASS(td->td_lock == TDQ_LOCKPTR(tdq));
-#ifndef VIMAGE
tdq_load_rem(tdq, td);
-#else
- tdq_load_rem(tdq, td, TD_TO_VPROCG(td));
-#endif
lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object);
}
KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count"));
More information about the p4-projects
mailing list