linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@digeo.com>
Cc: dipankar@in.ibm.com, linux-kernel@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
	paulus@samba.org
Subject: Re: [PATCH] kmalloc_percpu
Date: Wed, 07 May 2003 11:57:13 +1000	[thread overview]
Message-ID: <20030507023126.12F702C019@lists.samba.org> (raw)
In-Reply-To: Your message of "Tue, 06 May 2003 01:47:45 MST." <20030506014745.02508f0d.akpm@digeo.com>

In message <20030506014745.02508f0d.akpm@digeo.com> you write:
> Rusty Russell <rusty@rustcorp.com.au> wrote:
> >
> > It's a tradeoff, but I think it's worth it for a kmalloc_percpu which
> > is fast, space-efficient and numa-aware, since the code is needed
> > anyway.
> 
> I don't beleive that kmalloc_percpu() itself needs to be fast, as you say.
> 
> The code is _not_ NUMA-aware.  Is it?

No, it's arch-overridable.  You know me, I don't mess with
arch-specific stuff. 8)

> On 64GB 32-way that's 128MB of lowmem.  Unpopular.  I'd settle for a __setup
> thingy here, and a printk when the memory runs out.

Currently __setup is run far too late.  Fortunately Bartlomiej has
been working on moving __setup earlier, for other reasons (two-stage
parameter parsing).  In this case, it'd need to be before arch setup,
hmm...

> btw, what's wrong with leaving kmalloc_percpu() as-is, and only using this
> allocator for DEFINE_PERCPU()?

I figured that since the allocator is going to be there anyway, it
made sense to express kmalloc_percpu() in those terms.  If you think
the price is too high, I can respect that.

The more people use the __per_cpu_offset instead of
smp_processor_id(), the cheaper it gets, even to the stage where some
archs might want to express smp_processor_id() in terms of
__per_cpu_offset, rather than vice-versa.  Given that it's also more
space efficient (each var doesn't take one cacheline) too, I'd
recommend __alloc_percpu() of eg. single ints for long-lived objects
where I wouldn't recommend the current kmalloc_percpu().

Paul Mackerras points out that we could get the numa-aware allocation
plus "one big alloc" properties by playing with page mappings: reserve
1MB of virtual address, and map more pages as required.  I didn't
think that we'd need that yet, though.

So, numerous options, and you're smarter than me, so you can decide 8)
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2003-05-07  2:18 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05  8:08 [PATCH] kmalloc_percpu Rusty Russell
2003-05-05  8:47 ` Andrew Morton
2003-05-06  0:47   ` Rusty Russell
2003-05-06  1:52     ` Andrew Morton
2003-05-06  2:11       ` David S. Miller
2003-05-06  4:08         ` Rusty Russell
2003-05-06  3:40           ` David S. Miller
2003-05-06  5:02             ` Andrew Morton
2003-05-06  4:16               ` David S. Miller
2003-05-06  5:48                 ` Andrew Morton
2003-05-06  5:35                   ` David S. Miller
2003-05-06  6:55                     ` Andrew Morton
2003-05-06  5:57                       ` David S. Miller
2003-05-06  7:22                         ` Andrew Morton
2003-05-06  6:15                           ` David S. Miller
2003-05-06  7:34                             ` Andrew Morton
2003-05-06  8:42                               ` William Lee Irwin III
2003-05-06 14:38                               ` Martin J. Bligh
2003-05-06  7:20                       ` Dipankar Sarma
2003-05-06  8:28                       ` Rusty Russell
2003-05-06  8:47                         ` Andrew Morton
2003-05-07  1:57                           ` Rusty Russell [this message]
2003-05-07  2:41                             ` William Lee Irwin III
2003-05-07  4:03                               ` Paul Mackerras
2003-05-07  4:22                                 ` William Lee Irwin III
2003-05-07  4:56                                   ` Paul Mackerras
2003-05-07  5:19                                     ` William Lee Irwin III
2003-05-07  4:10                                       ` Martin J. Bligh
2003-05-07 12:13                                         ` William Lee Irwin III
2003-05-07  4:15                               ` Rusty Russell
2003-05-07  5:37                             ` Andrew Morton
2003-05-08  0:53                               ` Rusty Russell
2003-05-06 14:41                         ` Martin J. Bligh
2003-05-06  6:42                   ` Andrew Morton
2003-05-06  5:39                     ` David S. Miller
2003-05-06  6:57                       ` Andrew Morton
2003-05-06  7:25                         ` Jens Axboe
2003-05-06 10:41                           ` Ingo Oeser
2003-05-06 16:05                         ` Bryan O'Sullivan
2003-05-06  8:06               ` Rusty Russell
2003-05-06  5:03             ` Dipankar Sarma
2003-05-06  4:28           ` Andrew Morton
2003-05-06  3:37             ` David S. Miller
2003-05-06  4:11       ` Rusty Russell
2003-05-06  5:07   ` Ravikiran G Thirumalai
2003-05-06  8:03     ` Rusty Russell
2003-05-06  9:23       ` David S. Miller
2003-05-06  9:34       ` Ravikiran G Thirumalai
2003-05-06  9:38         ` Dipankar Sarma
2003-05-07  2:14         ` Rusty Russell
2003-05-07  5:51 ` Ravikiran G Thirumalai
2003-05-07  6:16   ` Rusty Russell
2003-05-08  7:42     ` Ravikiran G Thirumalai
2003-05-08  7:47       ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2002-10-31 16:06 [patch] kmalloc_percpu Ravikiran G Thirumalai
2002-11-01  8:33 ` Rusty Russell
2002-11-05 16:00   ` Dipankar Sarma

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=20030507023126.12F702C019@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@digeo.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).