From 3c6f29aac8aba4db3b4716003ab86acc466e3951 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 9 May 2004 23:28:10 -0700 Subject: [PATCH] [PATCH] sched: add enqueeu_task_head() From: Ingo Molnar Helper function for later patches --- kernel/sched.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/sched.c b/kernel/sched.c index 6ee2df67e6e02..7bf07d5942e06 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -331,6 +331,21 @@ static void enqueue_task(struct task_struct *p, prio_array_t *array) p->array = array; } +#ifdef CONFIG_SMP +/* + * Used by the migration code - we pull tasks from the head of the + * remote queue so we want these tasks to show up at the head of the + * local queue: + */ +static inline void enqueue_task_head(struct task_struct *p, prio_array_t *array) +{ + list_add(&p->run_list, array->queue + p->prio); + __set_bit(p->prio, array->bitmap); + array->nr_active++; + p->array = array; +} +#endif + /* * effective_prio - return the priority that is based on the static * priority but is modified by bonuses/penalties. -- 2.53.0