Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2008 07:15:05 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 137470 for review
Message-ID:  <200803120715.m2C7F5Fm011972@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=137470

Change 137470 by peter@peter_overcee on 2008/03/12 07:14:48

	move ts_rqindex to thread

Affected files ...

.. //depot/projects/bike_sched/sys/kern/kern_switch.c#9 edit
.. //depot/projects/bike_sched/sys/kern/sched_4bsd.c#15 edit
.. //depot/projects/bike_sched/sys/kern/sched_ule.c#15 edit
.. //depot/projects/bike_sched/sys/sys/proc.h#9 edit

Differences ...

==== //depot/projects/bike_sched/sys/kern/kern_switch.c#9 (text+ko) ====

@@ -404,7 +404,7 @@
 	int pri;
 
 	pri = TS_TO_TD(ts)->td_priority / RQ_PPQ;
-	ts->ts_rqindex = pri;
+	TS_TO_TD(ts)->td_rqindex = pri;
 	runq_setbit(rq, pri);
 	rqh = &rq->rq_queues[pri];
 	CTR5(KTR_RUNQ, "runq_add: td=%p ts=%p pri=%d %d rqh=%p",
@@ -421,7 +421,7 @@
 	struct rqhead *rqh;
 
 	KASSERT(pri < RQ_NQS, ("runq_add_pri: %d out of range", pri));
-	ts->ts_rqindex = pri;
+	TS_TO_TD(ts)->td_rqindex = pri;
 	runq_setbit(rq, pri);
 	rqh = &rq->rq_queues[pri];
 	CTR5(KTR_RUNQ, "runq_add_pri: td=%p ke=%p pri=%d idx=%d rqh=%p",
@@ -517,7 +517,7 @@
 		KASSERT(ts != NULL, ("runq_choose: no proc on busy queue"));
 		CTR4(KTR_RUNQ,
 		    "runq_choose_from: pri=%d ts=%p idx=%d rqh=%p",
-		    pri, ts, ts->ts_rqindex, rqh);
+		    pri, ts, TS_TO_TD(ts)->td_rqindex, rqh);
 		return (ts);
 	}
 	CTR1(KTR_RUNQ, "runq_choose_from: idleproc pri=%d", pri);
@@ -544,7 +544,7 @@
 
 	KASSERT(TS_TO_TD(ts)->td_flags & TDF_INMEM,
 		("runq_remove_idx: thread swapped out"));
-	pri = ts->ts_rqindex;
+	pri = TS_TO_TD(ts)->td_rqindex;
 	KASSERT(pri < RQ_NQS, ("runq_remove_idx: Invalid index %d\n", pri));
 	rqh = &rq->rq_queues[pri];
 	CTR5(KTR_RUNQ, "runq_remove_idx: td=%p, ts=%p pri=%d %d rqh=%p",

==== //depot/projects/bike_sched/sys/kern/sched_4bsd.c#15 (text+ko) ====

@@ -81,7 +81,6 @@
 struct td_sched {
 	TAILQ_ENTRY(td_sched) ts_procq;	/* (j/z) Run queue. */
 	fixpt_t		ts_pctcpu;	/* (j) %cpu during p_swtime. */
-	u_char		ts_rqindex;	/* (j) Run queue index. */
 	u_char		ts_flags;	/* (t) Flags */
 	int		ts_cpticks;	/* (j) Ticks of cpu time. */
 	int		ts_slptime;	/* (j) Seconds !RUNNING. */
@@ -672,7 +671,7 @@
 		return;
 	td->td_priority = prio;
 	if (TD_ON_RUNQ(td) && 
-	    TD_TO_TS(td)->ts_rqindex != (prio / RQ_PPQ)) {
+	    td->td_rqindex != (prio / RQ_PPQ)) {
 		sched_rem(td);
 		sched_add(td, SRQ_BORING);
 	}

==== //depot/projects/bike_sched/sys/kern/sched_ule.c#15 (text+ko) ====

@@ -85,7 +85,6 @@
 	TAILQ_ENTRY(td_sched) ts_procq;	/* Run queue. */
 	struct runq	*ts_runq;	/* Run-queue we're queued on. */
 	short		ts_flags;	/* TSF_* flags. */
-	u_char		ts_rqindex;	/* Run queue index. */
 	u_char		ts_cpu;		/* CPU that we have affinity for. */
 	int		ts_slice;	/* Ticks of slice remaining. */
 	u_int		ts_slptime;	/* Number of ticks we vol. slept */
@@ -346,7 +345,7 @@
 				TAILQ_FOREACH(ts, rqh, ts_procq) {
 					td = TS_TO_TD(ts);
 					printf("\t\t\ttd %p(%s) priority %d rqindex %d pri %d\n",
-					    td, td->td_name, td->td_priority, ts->ts_rqindex, pri);
+					    td, td->td_name, td->td_priority, td->td_rqindex, pri);
 				}
 			}
 	}

==== //depot/projects/bike_sched/sys/sys/proc.h#9 (text+ko) ====

@@ -213,6 +213,7 @@
 	volatile u_char td_owepreempt;  /* (k*) Preempt on last critical_exit */
 	short		td_locks;	/* (k) Count of non-spin locks. */
 	u_char		td_tsqueue;	/* (t) Turnstile queue blocked on. */
+	u_char		td_rqindex;
 	struct turnstile *td_blocked;	/* (t) Lock thread is blocked on. */
 	const char	*td_lockname;	/* (t) Name of lock blocked on. */
 	LIST_HEAD(, turnstile) td_contested;	/* (q) Contested locks. */



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