lkml.org 
[lkml]   [2002]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] de-xchg fork.c

On 23 Sep 2002, Robert Love wrote:

> > + task_cache[cpu] = current;
> > }
> > }
>
> I think you need get/put_cpu() here, too?

you are right - new patch attached.

Ingo

--- linux/kernel/fork.c.orig Mon Sep 23 20:28:36 2002
+++ linux/kernel/fork.c Mon Sep 23 20:55:08 2002
@@ -62,13 +62,15 @@
free_thread_info(tsk->thread_info);
kmem_cache_free(task_struct_cachep,tsk);
} else {
- int cpu = smp_processor_id();
+ int cpu = get_cpu();

- 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;
+ put_cpu();
}
}

@@ -126,8 +128,11 @@
{
struct task_struct *tsk;
struct thread_info *ti;
+ int cpu = get_cpu();

- tsk = xchg(task_cache + smp_processor_id(), NULL);
+ tsk = task_cache[cpu];
+ task_cache[cpu] = NULL;
+ put_cpu();
if (!tsk) {
ti = alloc_thread_info();
if (!ti)
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.040 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site