Skip to contentSkip to conversation

O(1) scheduler unlock_task_rq

PATCH In review Robert Love 2 participants 2 messages Jan 20, 2002 – Jan 21, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1011569639.850.354.camel@phantasy

#1 lore raw

PATCH 1/1 O(1) scheduler unlock_task_rq

In Ingo's new O(1) scheduler, unlock_task_rq takes a pointless argument (task_t * p).

This patch, against 2.5.3-pre2 + J2, removes the argument and fixes all known uses of the function.

Robert Love

kernel/sched.c +7 -8
@@ -70,11 +70,11 @@
 	return __rq;
 }
 
-static inline void unlock_task_rq(runqueue_t *rq, task_t *p,
-							unsigned long *flags)
+static inline void unlock_task_rq(runqueue_t *rq, unsigned long *flags)
 {
 	spin_unlock_irqrestore(&rq->lock, *flags);
 }
+
 /*
  * Adding/removing a task to/from a priority array:
  */
@@ -202,10 +202,10 @@
 	}
 	rq = lock_task_rq(p, &flags);
 	if (unlikely(rq->curr == p)) {
-		unlock_task_rq(rq, p, &flags);
+		unlock_task_rq(rq, &flags);
 		goto repeat;
 	}
-	unlock_task_rq(rq, p, &flags);
+	unlock_task_rq(rq, &flags);
 }
 
 /*
@@ -260,7 +260,7 @@
 			resched_task(rq->curr);
 		success = 1;
 	}
-	unlock_task_rq(rq, p, &flags);
+	unlock_task_rq(rq, &flags);
 	return success;
 }
 
@@ -639,7 +639,6 @@
 	spin_unlock_irq(&rq->lock);
 
 	reacquire_kernel_lock(current);
-	return;
 }
 
 /*
@@ -846,7 +845,7 @@
 			resched_task(rq->curr);
 	}
 out_unlock:
-	unlock_task_rq(rq, p, &flags);
+	unlock_task_rq(rq, &flags);
 }
 
 #ifndef __alpha__
@@ -966,7 +965,7 @@
 		activate_task(p, task_rq(p));
 
 out_unlock:
-	unlock_task_rq(rq, p, &flags);
+	unlock_task_rq(rq, &flags);
 out_unlock_tasklist:
 	read_unlock_irq(&tasklist_lock);
 
#2 lore raw
Quoted 5 lines · Robert Love

In Ingo's new O(1) scheduler, unlock_task_rq takes a pointless argument (task_t * p).

This patch, against 2.5.3-pre2 + J2, removes the argument and fixes all known uses of the function.

thanks Robert - i've added this to my tree.

Ingo