From: Ulrich Drepper <drepper@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: getting processor numbers
Date: Tue, 03 Apr 2007 11:21:21 -0700 [thread overview]
Message-ID: <46129B21.5090205@redhat.com> (raw)
In-Reply-To: <20070403181100.GE23689@one.firstfloor.org>
[-- Attachment #1: Type: text/plain, Size: 2049 bytes --]
Andi Kleen wrote:
> I would be opposed for adding another page per process at least
> because the per process memory footprint in Linux is imho already
> too large.
That's a single page shared by all threads on the system. Or make this
a page per NUMA node. And if the number of threads is larger than the
share counter for page, create a few more.
But in general the extra overhead would be minimal from the memory
consumption POV.
>> No, why? The vdso call would be so inexpensive (just a simple function
>> call) that it can be done whenever a topology-based decision has to be
>> made. Use cookies to determine whether nothing has been changed since
>> the last call etc.
>
> But how would that mix with the OpenMP use case where you have
> thread pools that normally don't make decisions afer startup, but
> just stay around?
There is a different between having threads in the thread pool and
actually using them. For every #omp loop the number of processors is
checked again and this is the number of threads from the pool which is used.
> I think for those you would need events of some sort
> to start or remove threads as needed.
We need no events if determining the number of processors is cheap.
There is really no reason why it shouldn't. Restarting all the threads
is not the cheapest operation so a single syscall (sys_sysconf, etc)
does not increase the cost a lot.
> If there's a good use case fine for me. However I suspect it's
> either "slow is ok" or "want it very fast" where even a syscall
> would hurt.
Ideally, as I said, an optimized vdso call is best. But a syscall is
OK. The nice thing about the vdso is that for now one could simply
implement it using a syscall and in future add optimizations to avoid
the kernel entry if possible.
A single syscall is two order of magnitude better than the best solution
available today. This is my main concern right now.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
next prev parent reply other threads:[~2007-04-03 18:21 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-03 16:54 getting processor numbers Ulrich Drepper
2007-04-03 17:30 ` linux-os (Dick Johnson)
2007-04-03 17:37 ` Ulrich Drepper
2007-04-03 17:56 ` Dr. David Alan Gilbert
2007-04-03 18:11 ` Andi Kleen
2007-04-03 17:17 ` Ulrich Drepper
2007-04-03 17:22 ` Alan Cox
2007-04-03 17:30 ` Andi Kleen
2007-04-03 20:24 ` Jeremy Fitzhardinge
2007-04-03 17:27 ` Andi Kleen
2007-04-03 17:30 ` Ulrich Drepper
2007-04-03 17:35 ` Andi Kleen
2007-04-03 17:45 ` Ulrich Drepper
2007-04-03 17:58 ` Andi Kleen
2007-04-03 18:05 ` Ulrich Drepper
2007-04-03 18:11 ` Andi Kleen
2007-04-03 18:21 ` Ulrich Drepper [this message]
2007-04-03 17:44 ` Siddha, Suresh B
2007-04-03 17:59 ` Ulrich Drepper
2007-04-03 19:40 ` Jakub Jelinek
2007-04-03 20:13 ` Ingo Oeser
2007-04-03 23:38 ` J.A. Magallón
2007-04-03 19:55 ` Ulrich Drepper
2007-04-03 20:13 ` Siddha, Suresh B
2007-04-03 20:19 ` Ulrich Drepper
2007-04-03 20:32 ` Eric Dumazet
2007-04-03 20:20 ` Nathan Lynch
2007-04-03 19:15 ` Davide Libenzi
2007-04-03 19:32 ` Ulrich Drepper
2007-04-04 0:31 ` H. Peter Anvin
2007-04-04 0:35 ` Jeremy Fitzhardinge
2007-04-04 0:38 ` H. Peter Anvin
2007-04-04 5:09 ` Eric Dumazet
2007-04-04 5:16 ` H. Peter Anvin
2007-04-04 5:22 ` Jeremy Fitzhardinge
2007-04-04 5:40 ` H. Peter Anvin
2007-04-04 5:46 ` Eric Dumazet
2007-04-04 5:29 ` Eric Dumazet
2007-04-03 20:16 ` Andrew Morton
[not found] ` <4612BB89.8040102@redhat.com>
[not found] ` <20070403141348.9bcdb13e.akpm@linux-foundation.org>
2007-04-03 22:13 ` Ulrich Drepper
2007-04-03 22:48 ` Andrew Morton
2007-04-03 23:00 ` Ulrich Drepper
2007-04-03 23:23 ` Andrew Morton
2007-04-03 23:54 ` Ulrich Drepper
2007-04-04 2:55 ` Paul Jackson
2007-04-04 8:39 ` Oleg Nesterov
2007-04-04 9:39 ` Ingo Molnar
2007-04-04 8:57 ` Oleg Nesterov
2007-04-04 10:01 ` Ingo Molnar
2007-04-04 2:58 ` Paul Jackson
2007-04-04 3:04 ` Paul Jackson
2007-04-04 2:52 ` Paul Jackson
2007-04-04 2:04 ` Paul Jackson
2007-04-04 6:47 ` Jakub Jelinek
2007-04-04 7:02 ` Paul Jackson
2007-04-04 14:51 ` Cliff Wickman
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=46129B21.5090205@redhat.com \
--to=drepper@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.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