linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Lin Ming <ming.m.lin@intel.com>,
	"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Subject: Re: [patch] SLQB slab allocator
Date: Fri, 23 Jan 2009 15:27:53 +0100	[thread overview]
Message-ID: <20090123142753.GK19986@wotan.suse.de> (raw)
In-Reply-To: <20090123140406.GR15750@one.firstfloor.org>

On Fri, Jan 23, 2009 at 03:04:06PM +0100, Andi Kleen wrote:
> [dropping lameters' outdated address]
> 
> On Fri, Jan 23, 2009 at 02:18:00PM +0100, Nick Piggin wrote:
> >  
> > > > Probably the best way would
> > > > be to have dynamic cpu and node allocs for them, I agree.
> > > 
> > > It's really needed.
> > > 
> > > > Any plans for an alloc_pernode?
> > > 
> > > It shouldn't be very hard to implement. Or do you ask if I'm volunteering? @)
> > 
> > Just if you knew about plans. I won't get too much time to work on
> 
> Not aware of anyone working on it.
> 
> > it next week, so I hope to have something in slab tree in the
> > meantime. I think it is OK to leave now, with a mind to improving
> 
> Sorry, the NR_CPUS/MAX_NUMNODE arrays are a merge blocker imho
> because they explode with CONFIG_MAXSMP.

This is a linux-next merge, I'm talking about. The point is to get
some parallelism between testing and making slqb perfect (not because
I don't agree with the problem you point out).

 
> > it before a possible mainline merge (there will possibly be more
> > serious issues discovered anyway).
> 
> I see you fixed the static arrays.
> 
> Doing the same for the kmem_cache arrays with making them a pointer
> and then using num_possible_{cpus,nodes}() would seem straight forward,
> wouldn't it?

Hmm, yes that might be the way to go. I'll do that with the node
array, the cpu array can stay where it is (this reduces cacheline
footprint for small NR_CPUS configs).

 
> Although I think I would prefer alloc_percpu, possibly with
> per_cpu_ptr(first_cpu(node_to_cpumask(node)), ...)

I don't think we have the NUMA information available early enough
to do that. But it would be the best idea indeed because it would
take advantage of improvements in percpu allocator.


> > But then it goes online and what happens? 
> 
> You already have a node online notifier that should handle that then, don't you?
> 
> x86-64 btw currently doesn't support node hotplug (but I expect it will
> be added at some point), but it should be ok even on architectures
> that do.
> 
> > Your numa_node_id() changes?
> 
> What do you mean?
> 
> > How does that work? Or you mean x86-64 does not do that same trick for
> > possible but offline nodes?
> 
> All I'm saying is that when x86-64 finds a memory less node it assigns
> its CPUs to other nodes. Hmm ok perhaps there's a backdoor when someone
> sets it with kmalloc_node() but that should normally not happen I think.

OK, but if it is _possible_ for the node to gain memory, then you
can't do that of course. If the node is always memoryless then yes
I think it is probably a good idea to just assign it to the closest node
with memory.


> > OK, but this code is just copied straight from SLAB... I don't want
> > to add such dependency at this point I'm trying to get something
> 
> I'm sure such a straight forward change could be still put into .29
> 
> > reasonable to merge. But it would be a fine cleanup.
> 
> Hmm to be honest it's a little weird to post so much code and then
> say you can't change large parts of it.

The cache_line_size() change wouldn't change slqb code significantly.
I have no problem with it, but I simply won't have time to do it and
test all architectures and get them merged and hold off merging
SLQB until they all get merged.


> Could you perhaps mark all the code you don't want to change?

Primarily the debug code from SLUB.
 

> I'm not sure I follow the rationale for not changing code that has been
> copied from elsewhere. If you copied it why can't you change it?

I have, very extensively. Just diff mm/slqb.c mm/slub.c ;)

The point of not cleaning up peripheral (non-core) code that works, and
exists upstream, is because it will actually be less hassle for me to
maintain. By all means make improvements to the slub version which I can
then pull into slqb.


> > That's my plan, but I go about it a different way ;) I don't want to
> > spend too much time on other allocators or cleanup etc code too much
> > right now (except cleanups in SLQB, which of course is required).
> 
> But still if you copy code from slub you can improve it, can't you?
> The sysfs code definitely could be done much nicer (ok for small values
> of "nice"; sysfs is always ugly of course @). But at least it can be
> done in a way that doesn't bloat the text so much.

I'm definitely not adverse to cleanups at all, but I just want to try
avoid duplicating work or diverging if it is not necessary which makes
it harder to track fixes etc. Just in this point in development...


> Thanks for the patch.
> 
> One thing I'm not sure about is using a private lock to hold off hotplug.
> I don't have a concrete scenario, but it makes me uneasy considering
> deadlocks when someone sleeps etc. Safer is get/put_online_cpus() 

I think it is OK, considering those locks must usually be taken anyway
in the path, I've just tended to widen the coverage. But I'll think if
anything can be improved with get/put API.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-01-23 14:27 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 14:30 [patch] SLQB slab allocator Nick Piggin
2009-01-21 14:59 ` Ingo Molnar
2009-01-21 15:17   ` Nick Piggin
2009-01-21 16:56   ` Nick Piggin
2009-01-21 17:40     ` Ingo Molnar
2009-01-23  3:31       ` Nick Piggin
2009-01-23  6:14       ` Nick Piggin
2009-01-23 12:56         ` Ingo Molnar
2009-01-21 17:59 ` Joe Perches
2009-01-23  3:35   ` Nick Piggin
2009-01-23  4:00     ` Joe Perches
2009-01-21 18:10 ` Hugh Dickins
2009-01-22 10:01   ` Pekka Enberg
2009-01-22 12:47     ` Hugh Dickins
2009-01-23 14:23       ` Hugh Dickins
2009-01-23 14:30         ` Pekka Enberg
2009-02-02  3:38         ` Zhang, Yanmin
2009-02-02  9:00           ` Pekka Enberg
2009-02-02 15:00             ` Christoph Lameter
2009-02-03  1:34               ` Zhang, Yanmin
2009-02-03  7:29             ` Zhang, Yanmin
2009-02-03 12:18               ` Hugh Dickins
2009-02-04  2:21                 ` Zhang, Yanmin
2009-02-05 19:04                   ` Hugh Dickins
2009-02-06  0:47                     ` Zhang, Yanmin
2009-02-06  8:57                     ` Pekka Enberg
2009-02-06 12:33                       ` Hugh Dickins
2009-02-10  8:56                         ` Zhang, Yanmin
2009-02-02 11:50           ` Hugh Dickins
2009-01-23  3:55   ` Nick Piggin
2009-01-23 13:57     ` Hugh Dickins
2009-01-22  8:45 ` Zhang, Yanmin
2009-01-23  3:57   ` Nick Piggin
2009-01-23  9:00   ` Nick Piggin
2009-01-23 13:34     ` Hugh Dickins
2009-01-23 13:44       ` Nick Piggin
2009-01-23  9:55 ` Andi Kleen
2009-01-23 10:13   ` Pekka Enberg
2009-01-23 11:25   ` Nick Piggin
2009-01-23 11:57     ` Andi Kleen
2009-01-23 13:18       ` Nick Piggin
2009-01-23 14:04         ` Andi Kleen
2009-01-23 14:27           ` Nick Piggin [this message]
2009-01-23 15:06             ` Andi Kleen
2009-01-23 15:15               ` Nick Piggin
2009-01-23 12:55   ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14  9:04 Nick Piggin
2009-01-14 10:53 ` Pekka Enberg
2009-01-14 11:47   ` Nick Piggin
2009-01-14 13:44     ` Pekka Enberg
2009-01-14 14:22       ` Nick Piggin
2009-01-14 14:45         ` Pekka Enberg
2009-01-14 15:09           ` Nick Piggin
2009-01-14 15:22             ` Nick Piggin
2009-01-14 15:30               ` Pekka Enberg
2009-01-14 15:59                 ` Nick Piggin
2009-01-14 18:40                   ` Christoph Lameter
2009-01-15  6:19                     ` Nick Piggin
2009-01-15 20:47                       ` Christoph Lameter
2009-01-16  3:43                         ` Nick Piggin
2009-01-16 21:25                           ` Christoph Lameter
2009-01-19  6:18                             ` Nick Piggin
2009-01-22  0:13                               ` Christoph Lameter
2009-01-22  9:27                                 ` Pekka Enberg
2009-01-22  9:30                                   ` Zhang, Yanmin
2009-01-22  9:33                                     ` Pekka Enberg
2009-01-23 15:32                                       ` Christoph Lameter
2009-01-23 15:37                                         ` Pekka Enberg
2009-01-23 15:42                                           ` Christoph Lameter
2009-01-23 15:32                                   ` Christoph Lameter
2009-01-23  4:09                                 ` Nick Piggin
2009-01-23 15:41                                   ` Christoph Lameter
2009-01-23 15:53                                     ` Nick Piggin
2009-01-26 17:28                                       ` Christoph Lameter
2009-02-03  1:53                                         ` Nick Piggin
2009-02-03 17:33                                           ` Christoph Lameter
2009-02-03 18:42                                             ` Pekka Enberg
2009-02-03 18:47                                               ` Pekka Enberg
2009-02-04  4:22                                                 ` Nick Piggin
2009-02-04 20:09                                                   ` Christoph Lameter
2009-02-05  3:18                                                     ` Nick Piggin
2009-02-04 20:10                                               ` Christoph Lameter
2009-02-05  3:14                                                 ` Nick Piggin
2009-02-04  4:07                                             ` Nick Piggin
2009-01-14 18:01             ` Christoph Lameter
2009-01-15  6:03               ` Nick Piggin
2009-01-15 20:05                 ` Christoph Lameter
2009-01-16  3:19                   ` Nick Piggin
2009-01-16 21:07                     ` Christoph Lameter
2009-01-19  5:47                       ` Nick Piggin
2009-01-22  0:19                         ` Christoph Lameter
2009-01-23  4:17                           ` Nick Piggin
2009-01-23 15:52                             ` Christoph Lameter
2009-01-23 16:10                               ` Nick Piggin
2009-01-23 17:09                                 ` Nick Piggin
2009-01-26 17:46                                   ` Christoph Lameter
2009-02-03  1:42                                     ` Nick Piggin
2009-01-26 17:34                                 ` Christoph Lameter
2009-02-03  1:48                                   ` Nick Piggin

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=20090123142753.GK19986@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ming.m.lin@intel.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=yanmin_zhang@linux.intel.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;
as well as URLs for NNTP newsgroup(s).