Re: Scheduler Bug (set_cpus_allowed)

Andrea Arcangeli (andrea@suse.de)
Wed, 12 Jun 2002 02:00:23 +0200


Hello,

On Sat, Jun 08, 2002 at 01:20:04AM +0200, J.A. Magallon wrote:
>
> On 2002.06.07 Robert Love wrote:
> >
> >Anyhow, with this issue, I guess we need to fix it... I'll send a patch
> >to Linus.
> >
>
> Plz, could you also post it in the list ? -aa will need also...

So far I merged this Ingo's fix into my tree, I will overview the other
parts soon (as worse next week).

diff -urNp frozen-ref/include/linux/sched_runqueue.h frozen/include/linux/sched_runqueue.h
--- frozen-ref/include/linux/sched_runqueue.h Tue Jun 11 03:03:35 2002
+++ frozen/include/linux/sched_runqueue.h Tue Jun 11 03:00:46 2002
@@ -57,7 +57,6 @@ struct prio_array {
*/
struct runqueue {
spinlock_t lock;
- spinlock_t frozen;
unsigned long nr_running, nr_switches, expired_timestamp;
long quiescent; /* RCU */
task_t *curr, *idle;
diff -urNp frozen-ref/kernel/sched.c frozen/kernel/sched.c
--- frozen-ref/kernel/sched.c Tue Jun 11 03:03:35 2002
+++ frozen/kernel/sched.c Tue Jun 11 03:01:29 2002
@@ -352,7 +352,7 @@ void sched_exit(task_t * p)
#if CONFIG_SMP
asmlinkage void schedule_tail(task_t *prev)
{
- spin_unlock_irq(&this_rq()->frozen);
+ spin_unlock_irq(&this_rq()->lock);
}
#endif

@@ -762,9 +762,6 @@ switch_tasks:
if (likely(prev != next)) {
rq->nr_switches++;
rq->curr = next;
- spin_lock(&rq->frozen);
- spin_unlock(&rq->lock);
-
context_switch(prev, next);

/*
@@ -774,10 +771,8 @@ switch_tasks:
*/
smp_mb();
rq = this_rq();
- spin_unlock_irq(&rq->frozen);
- } else {
- spin_unlock_irq(&rq->lock);
}
+ spin_unlock_irq(&rq->lock);

reacquire_kernel_lock(current);
if (need_resched())
@@ -1539,7 +1534,6 @@ void __init sched_init(void)
rq->active = rq->arrays;
rq->expired = rq->arrays + 1;
spin_lock_init(&rq->lock);
- spin_lock_init(&rq->frozen);
INIT_LIST_HEAD(&rq->migration_queue);

for (j = 0; j < 2; j++) {

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/