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: Wed, 12 Nov 2008 16:50:46 -0600 (CST) [thread overview]
Message-ID: <Pine.LNX.4.64.0811121630390.2379@quilx.com> (raw)
In-Reply-To: <200811130831.11499.rusty@rustcorp.com.au>
On Thu, 13 Nov 2008, Rusty Russell wrote:
> > > You've introduced a third set of per-cpu primitives, yet the second set
> > > still has 0 users.
> >
> > What second set?
>
> percpu_alloc().
That is a variant of allocpercpu. We have thinned the allocpercpu API
somewhat already. I can drop more portions or I can drop it completely at
the very end of the patchset.
> > cpu. The difference between THIS_CPU and __THIS_CPU is the context check
> > by smp_processor_id()
>
> Thanks, I figured that out, but it's not documented. I'll happily create a
> patch, but see below. BTW, did you end up using __THIS_CPU anywhere?
Yes in later patches. This is a total set of 40 or so patches.
> > The caps functions are macros not functions. Macros are
> > capitalized.
>
> Traditionally, yes, but we seem to be more ambivalent in the kernel.
> list_for_each() et. al spring to mind: code would be uglier if we made them
> caps.
Macros being capitalized have a reason: They may do strange things with
the parameters. In particular CPU_ALLOC/CPU_FREE do a determination of
the size of the type. The macros do not take an argument in the
traditional sense. Frankly alloc_percpu(type) is something that looks not
right to me.
> > alloc_percpu must stay until the last remains have been
> > evicted.
>
> OK, you anticipate replacement of all alloc_percpu users?
Yes. If you look at the full patchsets that were posted at various times
during the last year you see that allocpercpu will be gone.
> > And the API does work differently.
>
> I'm afraid the difference has escaped me so far. Please explain why you can't
> use the current API. Is this subtle difference going to make the transition
> difficult?
The old api was based on an attempt to introduce a cpu mask. That mask was
never used. See percpu_alloc_mask. The handling is not consistent with the
nature of the percpu sections for other percpu data because allocation is
only done for online processors. So we have semantic differences. The API
is inconsistent and underwent rot. Having to allocate percpu sections if
processors are onlined and offlined causes the need for more hooks. The
cpu alloc patchset gets rid of about half the hooks in the page allocator
and slab allocator.
next prev parent reply other threads:[~2008-11-12 22:51 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 [this message]
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
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.0811121630390.2379@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®