[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAJd=RBCQpVgNzAiFn5q1MnJAqctOrOZGK7U-GyCkHWg=TfCyCw@mail.gmail.com>
Date: Mon, 14 May 2012 21:21:31 +0800
From: Hillf Danton <dhillf@...il.com>
To: LKML <linux-kernel@...r.kernel.org>,
Hillf Danton <dhillf@...il.com>
Subject: [2/3] BFS 420: compact enqueue_task
A helper is added to reflect the meat of the two enqueue routines.
--- a/kernel/sched/bfs.c Mon May 14 20:50:38 2012
+++ b/kernel/sched/bfs.c Mon May 14 20:53:28 2012
@@ -698,6 +698,16 @@ static bool isoprio_suitable(void)
return !grq.iso_refractory;
}
+static void __enqueue_task(struct task_struct *p, bool at_head)
+{
+ __set_bit(p->prio, grq.prio_bitmap);
+ if (at_head)
+ list_add(&p->run_list, grq.queue + p->prio);
+ else
+ list_add_tail(&p->run_list, grq.queue + p->prio);
+ sched_info_queued(p);
+}
+
/*
* Adding to the global runqueue. Enter with grq locked.
*/
@@ -711,17 +721,13 @@ static void enqueue_task(struct task_str
else
p->prio = NORMAL_PRIO;
}
- __set_bit(p->prio, grq.prio_bitmap);
- list_add_tail(&p->run_list, grq.queue + p->prio);
- sched_info_queued(p);
+ __enqueue_task(p, false);
}
/* Only idle task does this as a real time task*/
static inline void enqueue_task_head(struct task_struct *p)
{
- __set_bit(p->prio, grq.prio_bitmap);
- list_add(&p->run_list, grq.queue + p->prio);
- sched_info_queued(p);
+ __enqueue_task(p, true);
}
static inline void requeue_task(struct task_struct *p)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists