From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Chris Friesen <cfriesen@nortel.com>
Cc: Bill Davidsen <davidsen@tmr.com>,
linux-kernel@vger.kernel.org,
Jim Nance <jlnance@sdf.lonestar.org>,
Dave Jones <davej@redhat.com>, Willy Tarreau <willy@w.ods.org>,
Andrew Morton <akpm@osdl.org>, Ricky Beam <jfbeam@bluetronic.net>,
nico-kernel@schottelius.org
Subject: Re: /proc/cpuinfo format - arch dependent!
Date: Mon, 9 May 2005 16:26:37 -0400 [thread overview]
Message-ID: <20050509202637.GF2297@csclub.uwaterloo.ca> (raw)
In-Reply-To: <427FC366.1000506@nortel.com>
On Mon, May 09, 2005 at 02:09:10PM -0600, Chris Friesen wrote:
> Bill Davidsen wrote:
>
> >Might I suggest that if you like the "we know best just trust us"
> >approach, there is another OS to use. Making information available to
> >good applications will improve system performance, or at least allow
> >better limitation of requests for resources
>
> What will you do with the information? The kernel is doing all the
> resource allocation and scheduling.
>
> From a higher-level, the application wants the best performance.
> Doesn't it make more sense to have an API that lets you query things
> like: how many cores do I have, how many separate memory interfaces do I
> have, how many cores handle interrupts, etc.
>
> Based on that information you tell the system: "I've got 4 processes,
> please put them all on cores with separate memory connectivity since
> they're all memory-intensive. Now please put these other two threads on
> the same cpu since they share memory but serialize each other by design."
>
> The app shouldn't care about the details of architecture, but it should
> be able to work with the system to give the best performance.
What if the process is able to split itself into say 4 or 8 or 16
threads, but if you only have the hardware to run 2 threads you migth
get less context switch overhead running less threads at a time, while
if you have 16 cpus available, running 4 threads will not be the fastest
way to get the job done. Being able to "optimally" configure the
program on the fly might be handy (although a config setting of the
optimal config on the particular machine would do the same thing).
Now on the other hand if the process could tell that there were 8 cpu
cores and decided to run 8 threads, but the admin was running another
program already that was using 4 cores, then auto detecting the core
count and starting 8 threads might still be inefficient, and 4 would
have been optimal.
I think make has the right idea. Let the user and/or admin decide how
to allocate the resources. If they don't know what they are doing, well
who does. As long as the user can tell what their machine is they
should be able to decide how many threads to start in a given program.
/proc/cpuinfo as it is currently, is not too bad for that task.
Adding an option or config setting to the program where the user can
tell it how many threads to run seems like the right solution, while if
the program is simpler to write as 2 threads running at the same time
with no obvious overhead from doing it that way, then run it as 2 threads
even if you only have 1 cpu core to run it. Context switches are hardly
that expensive on a modern machine.
Len Sorensen
next prev parent reply other threads:[~2005-05-09 20:27 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 12:15 Nico Schottelius
2005-04-19 13:24 ` Lennart Sorensen
2005-04-19 19:17 ` Lee Revell
2005-04-19 20:00 ` Nico Schottelius
2005-04-19 20:02 ` David S. Miller
2005-04-19 20:12 ` Lennart Sorensen
2005-04-19 20:42 ` Lee Revell
2005-04-19 20:54 ` Nico Schottelius
2005-04-19 21:12 ` Grzegorz Kulewski
2005-04-20 20:31 ` Ralf Baechle
2005-05-07 3:37 ` Ricky Beam
2005-05-07 4:01 ` Stefan Smietanowski
2005-05-07 7:55 ` Ricky Beam
2005-05-07 17:51 ` Stefan Smietanowski
2005-05-07 18:05 ` Ricky Beam
2005-05-07 18:46 ` Dr. David Alan Gilbert
2005-05-07 4:14 ` Andrew Morton
2005-05-07 7:58 ` Willy Tarreau
2005-05-07 16:53 ` Dave Jones
2005-05-07 17:05 ` Willy Tarreau
2005-05-07 17:20 ` Dave Jones
2005-05-07 17:18 ` Willy Tarreau
2005-05-08 1:25 ` Jim Nance
2005-05-08 16:11 ` John Kacur
2005-05-09 18:14 ` Bill Davidsen
2005-05-09 20:09 ` Chris Friesen
2005-05-09 20:26 ` Lennart Sorensen [this message]
2005-05-09 21:25 ` Brian O'Mahoney
2005-05-10 16:21 ` Bill Davidsen
2005-05-10 16:34 ` Chris Friesen
2005-05-10 2:23 ` Jim Nance
2005-05-10 4:12 ` Willy Tarreau
2005-05-10 7:13 ` Paul Jackson
2005-05-10 16:34 ` Bill Davidsen
2005-05-07 17:54 ` Stefan Smietanowski
2005-05-07 18:05 ` Willy Tarreau
2005-05-09 18:03 ` Bill Davidsen
2005-05-10 7:21 ` Paul Jackson
2005-05-10 14:38 ` Lennart Sorensen
2005-05-10 16:37 ` Bill Davidsen
2005-05-09 18:00 ` Bill Davidsen
2005-05-09 19:58 ` Lennart Sorensen
2005-05-10 16:49 ` Bill Davidsen
[not found] <3UZS7-5ue-17@gated-at.bofh.it>
[not found] ` <41ouh-4QE-1@gated-at.bofh.it>
[not found] ` <41oXl-5hl-7@gated-at.bofh.it>
[not found] ` <41sxX-8cN-11@gated-at.bofh.it>
[not found] ` <41BL4-7l7-15@gated-at.bofh.it>
2005-05-07 23:33 ` Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>
2005-05-08 13:24 ` Andi Kleen
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=20050509202637.GF2297@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=akpm@osdl.org \
--cc=cfriesen@nortel.com \
--cc=davej@redhat.com \
--cc=davidsen@tmr.com \
--cc=jfbeam@bluetronic.net \
--cc=jlnance@sdf.lonestar.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nico-kernel@schottelius.org \
--cc=willy@w.ods.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
all inboxes | Powered by JetHome®