Skip to contentSkip to conversation

use cached variable in sys_sched_yield()

PATCH New Renaud Lienhart 1 participant 1 message Sep 3, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use cached variable in sys_sched_yield()

In sys_sched_yield(), we cache current->array in the "array" variable, thus there's no need to dereference "current" again later.

kernel/sched.c +1 -1
@@ -4058,7 +4058,7 @@
 	if (rt_task(current))
 		target = rq->active;
 
-	if (current->array->nr_active == 1) {
+	if (array->nr_active == 1) {
 		schedstat_inc(rq, yld_act_empty);
 		if (!rq->expired->nr_active)
 			schedstat_inc(rq, yld_both_empty);