lkml.org 
[lkml]   [2009]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 2/3] generic-ipi: remove kmalloc()
From
Date
On Wed, 2009-02-18 at 16:01 +1030, Rusty Russell wrote:
> On Wednesday 18 February 2009 08:29:06 Peter Zijlstra wrote:
> > Remove the use of kmalloc() from the smp_call_function_*() calls.
>
> This patch is actually quite nice. Not sure it's correct, but it's neat :)

:-)

> One minor quibble:
>
> > + data = &per_cpu(csd_data, me);
>
> "data = &__get_cpu_var(csd_data);" is slightly preferred. A few less cycles.

Thanks, next version will include the below.

Index: linux-2.6/kernel/smp.c
===================================================================
--- linux-2.6.orig/kernel/smp.c
+++ linux-2.6/kernel/smp.c
@@ -325,7 +325,7 @@ int smp_call_function_single(int cpu, vo
* will make sure the callee is done with the
* data before a new caller will use it.
*/
- data = &per_cpu(csd_data, me);
+ data = &__get_cpu_var(csd_data);
csd_lock(data);
} else {
data = &d;
@@ -413,7 +413,7 @@ void smp_call_function_many(const struct
return;
}

- data = &per_cpu(cfd_data, me);
+ data = &__get_cpu_var(cfd_data);
csd_lock(&data->csd);

spin_lock_irqsave(&data->lock, flags);



\
 
 \ /
  Last update: 2009-02-18 12:23    [W:0.148 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site