Skip to contentSkip to conversation

sched: Use task_rq_unlock on __sched_setscheduler

PATCH In review Namhyung Kim 3 participants 3 messages Jul 7, 2012 – Jul 26, 2012 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: Use task_rq_unlock on __sched_setscheduler

From: Namhyung Kim <[email protected]>

It seems there's no specific reason to open-code it. I guess the commit 0122ec5b02f76 ("sched: Add p->pi_lock to task_rq_lock()") simply missed it. Let's be consistent with others.

---
 kernel/sched/core.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/sched/core.c +1 -3
index 3987b9ddc563..1327f4de2054 100644
@@ -4343,9 +4343,7 @@ recheck:
 	 */
 	if (unlikely(policy == p->policy && (!rt_policy(policy) ||
 			param->sched_priority == p->rt_priority))) {
-
-		__task_rq_unlock(rq);
-		raw_spin_unlock_irqrestore(&p->pi_lock, flags);
+		task_rq_unlock(rq, p, &flags);
 		return 0;
 	}
 
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 5 lines · Namhyung Kim

From: Namhyung Kim <[email protected]>

It seems there's no specific reason to open-code it. I guess the commit 0122ec5b02f76 ("sched: Add p->pi_lock to task_rq_lock()") simply missed it. Let's be consistent with others.

Looks that way, thanks!

#2 lore raw

[tip:sched/urgent] sched: Use task_rq_unlock() in __sched_setscheduler()

In reply to Namhyung Kim
Commit-ID:  45afb1734fa6323a8ba08bd6c392ee227df67dde
Gitweb:     http://git.kernel.org/tip/45afb1734fa6323a8ba08bd6c392ee227df67dde
Author:     Namhyung Kim <[email protected]>
AuthorDate: Sat, 7 Jul 2012 16:49:02 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 26 Jul 2012 11:46:59 +0200

sched: Use task_rq_unlock() in __sched_setscheduler()

It seems there's no specific reason to open-code it. I guess commit 0122ec5b02f76 ("sched: Add p->pi_lock to task_rq_lock()") simply missed it. Let's be consistent with others.

---
 kernel/sched/core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
kernel/sched/core.c +1 -3
index 5d011ef..2cb4e77 100644
@@ -4340,9 +4340,7 @@ recheck:
 	 */
 	if (unlikely(policy == p->policy && (!rt_policy(policy) ||
 			param->sched_priority == p->rt_priority))) {
-
-		__task_rq_unlock(rq);
-		raw_spin_unlock_irqrestore(&p->pi_lock, flags);
+		task_rq_unlock(rq, p, &flags);
 		return 0;
 	}