From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Nick Piggin <npiggin@suse.de>, Jens Axboe <jens.axboe@oracle.com>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH 2/3] generic-ipi: remove kmalloc()
Date: Wed, 18 Feb 2009 11:52:29 +0100 [thread overview]
Message-ID: <1234954349.4637.59.camel@laptop> (raw)
In-Reply-To: <200902181601.06738.rusty@rustcorp.com.au>
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);
next prev parent reply other threads:[~2009-02-18 10:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-17 21:59 [PATCH 0/3] generic-ipi: patches -v5 Peter Zijlstra
2009-02-17 21:59 ` [PATCH 1/3] generic-ipi: simplify the barriers Peter Zijlstra
2009-02-18 0:27 ` Paul E. McKenney
2009-02-18 9:45 ` Peter Zijlstra
2009-02-17 21:59 ` [PATCH 2/3] generic-ipi: remove kmalloc() Peter Zijlstra
2009-02-18 0:28 ` Paul E. McKenney
2009-02-18 10:42 ` Peter Zijlstra
2009-02-18 16:06 ` Paul E. McKenney
2009-02-18 16:15 ` Oleg Nesterov
2009-02-18 19:47 ` Paul E. McKenney
2009-02-18 20:12 ` Oleg Nesterov
2009-02-19 2:40 ` Paul E. McKenney
2009-02-19 8:33 ` Peter Zijlstra
2009-02-18 5:31 ` Rusty Russell
2009-02-18 10:52 ` Peter Zijlstra [this message]
2009-02-17 21:59 ` [PATCH 3/3] generic-ipi: remove CSD_FLAG_WAIT Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1234954349.4637.59.camel@laptop \
--to=a.p.zijlstra@chello.nl \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.