Re: [PATCH] de-xchg fork.c

Robert Love (rml@tech9.net)
23 Sep 2002 14:30:34 -0400


On Mon, 2002-09-23 at 14:31, Ingo Molnar wrote:

> the attached patch (against BK-curr) fixes all xchg()'s and a preemption
> bug.

Thanks, Ingo.

> --- linux/kernel/fork.c.orig Mon Sep 23 20:28:36 2002
> +++ linux/kernel/fork.c Mon Sep 23 20:30:02 2002
> @@ -64,11 +64,12 @@
> } else {
> int cpu = smp_processor_id();
>
> - tsk = xchg(task_cache + cpu, tsk);
> + tsk = task_cache[cpu];
> if (tsk) {
> free_thread_info(tsk->thread_info);
> kmem_cache_free(task_struct_cachep,tsk);
> }
> + task_cache[cpu] = current;
> }
> }

I think you need get/put_cpu() here, too?

Robert Love

-
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/