From: Christoph Lameter <cl@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Eric Dumazet <dada1@cosmosbay.com>, Takashi Iwai <tiwai@suse.de>,
Andreas Gruenbacher <agruen@suse.de>,
Jan Blunck <jblunck@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Mike Travis <travis@sgi.com>
Subject: Re: [PATCH] Allocate module.ref array dynamically
Date: Thu, 13 Nov 2008 18:20:41 -0600 (CST) [thread overview]
Message-ID: <Pine.LNX.4.64.0811131759250.7010@quilx.com> (raw)
In-Reply-To: <200811141019.49493.rusty@rustcorp.com.au>
On Fri, 14 Nov 2008, Rusty Russell wrote:
> > alloc_percpu() does not allow specifying a GFP mask therefore does not
> > support zeroing and is not extendable for the future.
>
> It is defined to be zeroing. And it is very unclear that (1) future
> implementations will be able to support GFP_ATOMIC reasonably, and (2) that we
> want people to do that. If we do, we fix it.
But some uses do not need zeroing. They currently have no choice. And
other flags can become necessary if percpu areas gain the ability of
being dynamically extended. Zeroing percpu areas on systems with
lots of cpus can take awhile in particular since these areas may be on
remote nodes.
> > It does not allow
> > specifying an alignment therefore tight packing is not possible.
>
> It absolutely does. That's why it takes a type!
alloc_percpu is based on __alloc_percpu which currently does not take an
alignment. Guess we could get there by removing the intermediate
functions and making alloc_percpu call cpu_alloc.
However, there are only a few places that use allocpercpu and all of
those are touched by necesssity by the full cpu alloc patchset. At mininum
we need to add the allocation flags and add cpu ops as well as review the
preemption at each call site etcin order to use the correct
call. So why bother with the old API?
> > CPU_PTR and THIS_CPU can be applied both to percpu pointers and
> > percpu variables. The new API unifies the handling which is required in
> > order for the new cpu_ops to work both on statically and dynamically
> > allocated percpu data.
>
> And if you called them per_cpu_ptr and __get_cpu_ptr they would have these
> same properties. But now the names would be consistent.
Having macros that do type casting on results and do macro operations on
parameters look like functions does not seem to be right. We can make it
consistent at the end by renaming the remaining ones.
Having an uppercase CPU_PTR and such in the source clarifies
that something special is going on. This is consistent with other
uses in the kernel. This is CPP magic after all (see examples in
include/linux/kernel.h or slab.h f.e.)
next prev parent reply other threads:[~2008-11-14 0:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-11 20:01 Takashi Iwai
2008-11-11 22:06 ` Eric Dumazet
2008-11-11 22:15 ` Eric Dumazet
2008-11-11 22:32 ` Takashi Iwai
2008-11-11 22:26 ` Takashi Iwai
2008-11-12 1:44 ` Rusty Russell
2008-11-12 2:26 ` Mike Travis
2008-11-12 3:17 ` Christoph Lameter
2008-11-12 13:46 ` Mike Travis
2008-11-12 3:14 ` Christoph Lameter
2008-11-12 9:59 ` Rusty Russell
2008-11-12 20:11 ` Christoph Lameter
2008-11-12 22:01 ` Rusty Russell
2008-11-12 22:50 ` Christoph Lameter
2008-11-13 9:21 ` Rusty Russell
2008-11-13 14:40 ` Christoph Lameter
2008-11-13 23:49 ` Rusty Russell
2008-11-14 0:20 ` Christoph Lameter [this message]
2008-11-16 0:00 ` Rusty Russell
2008-11-16 21:41 ` Rusty Russell
2008-11-20 16:47 ` Christoph Lameter
2008-11-20 23:21 ` Rusty Russell
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=Pine.LNX.4.64.0811131759250.7010@quilx.com \
--to=cl@linux-foundation.org \
--cc=agruen@suse.de \
--cc=akpm@linux-foundation.org \
--cc=dada1@cosmosbay.com \
--cc=jblunck@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=tiwai@suse.de \
--cc=travis@sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®