From: Jes Sorensen <jes@sgi.com>
To: Andi Kleen <ak@suse.de>
Cc: discuss@x86-64.org, Tony Luck <tony.luck@intel.com>,
linux-kernel@vger.kernel.org, libc-alpha@sourceware.org,
vojtech@suse.cz, linux-ia64@vger.kernel.org
Subject: Re: [discuss] Re: FOR REVIEW: New x86-64 vsyscall vgetcpu()
Date: Tue, 20 Jun 2006 10:28:36 +0200 [thread overview]
Message-ID: <4497B1B4.3020307@sgi.com> (raw)
In-Reply-To: <200606161654.15881.ak@suse.de>
Andi Kleen wrote:
>> I really don't see the benefit here. malloc already gets pages handed
>> down from the kernel which are node local due to them being assigned at
>> a first touch basis. I am not sure about glibc's malloc internals, but
>> rather rely on a vgetcpu() call, all it really needs to do is to keep
>> a thread local pool which will automatically get it's thing locally
>> through first touch usage.
>
> That would add too much overhead on small systems. It's better to be
> able to share the pools. vgetcpu allows that.
How do you expect to be able to share the pools? Or are you saying you
just one page per numa node? Having a page per thread is not noticable
and for databases, which was your primary target usergroup, I think it's
fair to see it won't even be visible as noise.
>>> Basically it is just for extending the existing already used proven etc.
>>> default local policy to sub pages. Also there might be other uses
>>> of it too (like per CPU data), although I expect most use of that
>>> in user space can be already done using TLS.
>> The thread libraries already have their own thread local area which
>> should be allocated on the thread's own node if done right, which I
>> assume it is.
>
> - The heap for small allocations is shared (although this can be tuned)
> - When another thread does free() you need special handling to keep
> the item in the correct free lists
> This is one of the tricky bits in the new kernel NUMA slab allocator
> too.
It should be pretty easy to make the allocator aware of the per thread
regions based on the address.
>> If you migrate your app elsewhere, you should migrate the pages with it,
>> or not expect things to run with the local effect.
>
> That's too costly to do by default and you have no guarantee that it will amortize.
But if you don't migrate the pages with it, the numa aware allocation is
wasted anyway, whether you do it on a first-touch basis or using
vgetcpu.
>> I don't really see the point in solving something half way when it can
>> be done better. Maybe the "serious" databases should open up and let us
>> know what the problem is they are hitting.
>
> I see no indication of anything better so far from you. You only offered
> static configuration instead which while in some cases is better
> doesn't work in the general case.
Static configuration? I never said anything about that, I said that libc
should offer a memory pool per thread and have it created when it's
first touched by the thread. That solves exactly what you have described
so far unless is something else you also expect to benefit from
vgetcpu().
Jes
next prev parent reply other threads:[~2006-06-20 8:28 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-14 7:42 FOR REVIEW: New x86-64 vsyscall vgetcpu() Andi Kleen
2006-06-14 10:47 ` Alan Cox
2006-06-14 14:54 ` Steve Munroe
2006-06-15 23:17 ` Benjamin Herrenschmidt
[not found] ` <449029DB.7030505@redhat.com>
[not found] ` <200606141752.02361.ak@suse.de>
2006-06-14 16:30 ` Ulrich Drepper
2006-06-14 17:34 ` [discuss] " Andi Kleen
2006-06-15 18:44 ` Tony Luck
2006-06-16 6:22 ` Andi Kleen
2006-06-16 7:23 ` Gerd Hoffmann
2006-06-16 7:37 ` Andi Kleen
2006-06-16 9:48 ` Jes Sorensen
2006-06-16 10:09 ` Andi Kleen
2006-06-16 11:02 ` Jes Sorensen
2006-06-16 11:17 ` Andi Kleen
2006-06-16 11:58 ` Jes Sorensen
2006-06-16 12:36 ` Zoltan Menyhart
2006-06-16 12:41 ` Jes Sorensen
2006-06-16 12:48 ` Zoltan Menyhart
2006-06-16 21:04 ` Chase Venters
2006-06-16 14:56 ` Andi Kleen
2006-06-16 15:31 ` Zoltan Menyhart
2006-06-16 15:37 ` Andi Kleen
2006-06-16 15:58 ` Jakub Jelinek
2006-06-16 16:24 ` Andi Kleen
2006-06-16 16:33 ` Jakub Jelinek
2006-06-16 21:12 ` Chase Venters
2006-06-16 15:36 ` Brent Casavant
2006-06-16 15:40 ` Andi Kleen
2006-06-16 21:15 ` Chase Venters
2006-06-16 21:19 ` Chase Venters
2006-06-16 23:40 ` Brent Casavant
2006-06-17 6:58 ` Andi Kleen
2006-06-17 6:55 ` [discuss] " Andi Kleen
2006-06-19 8:42 ` Zoltan Menyhart
2006-06-19 8:54 ` Andi Kleen
2006-06-16 14:54 ` Andi Kleen
2006-06-20 8:28 ` Jes Sorensen [this message]
2006-06-19 0:15 ` Paul Jackson
2006-06-19 8:21 ` Andi Kleen
2006-06-19 10:09 ` Paul Jackson
2006-06-21 1:18 ` Paul Jackson
2006-06-21 1:21 ` Paul Jackson
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=4497B1B4.3020307@sgi.com \
--to=jes@sgi.com \
--cc=ak@suse.de \
--cc=discuss@x86-64.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=vojtech@suse.cz \
/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