From: Bill Davidsen <davidsen@tmr.com>
To: Jim Nance <jlnance@sdf.lonestar.org>
Cc: 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, linux-kernel@vger.kernel.org
Subject: Re: /proc/cpuinfo format - arch dependent!
Date: Tue, 10 May 2005 12:34:07 -0400 [thread overview]
Message-ID: <4280E27F.8040808@tmr.com> (raw)
In-Reply-To: <20050510022301.GA13763@SDF.LONESTAR.ORG>
Jim Nance wrote:
> Good Afternoon Bill,
>
> Thanks for the input. Let me make a couple of comments.
>
> On Mon, May 09, 2005 at 02:14:14PM -0400, 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, and bad applications will
>>be bad regardless of what you hide. You don't hide the CPU hardware any
>>more than the memory size.
>
>
> You could use a similar argument for cooperative rather than
> preemptive multitasking. It might even be a valid argument,
> assuming you controlled all the processes running on the system.
> But it didn't work very well in practice.
>
> I see two problems with encouraging applications to get involved
> with processor selection.
>
> The first is they don't have enough information to get it right.
The application doesn't have to get it "right" however you define that,
but unless you expect to extend the API to add a
signal(STARTMORETHREADS) it makes sense for the application to have some
idea what the hardware config is, because the kernel doesn't know what
the application is going to do (future) vs. what it already did (past).
Running a number of threads somewhat close to the number of CPUs, or
sockets, or something else the application can know is far better than
starting 64 threads in case this is a big NUMA machine, or running
single thread while seven of eight CPUs do nothing.
By looking at Ncpu and ldavg a smart application can avoid being really
wrong, which gives the kernel a better chance of improving throughput.
> There are going to be other processes running on the machine.
> The optimal set of processors to run on is going to depend on
> what else is running and what it is doing at that instant. This
> isn't information a usermode process has good access to. Say I
> have an application that wants to bind its 2 threads to the two
> processors on a single SMT chip. Now say I run two of these
> applications on a machine with 2 SMT chips on it. What keeps
> both of them from binding themselves to the same chip? Should
> it be the applications responsibility to look through the process
> table and see what other applicatioins are bound to what processors?
> What prevents races if they do?
If the application can choose a sane number of threads, that makes the
problem of memory management and CPU scheduling easier. Just because the
application can't do a perfect job doesn't mean that it should do
without information needed to do something reasonable.
Perfect is the enemy of better.
next prev parent reply other threads:[~2005-05-10 19:17 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 12:15 /proc/cpuinfo format - arch dependent! 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
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 [this message]
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=4280E27F.8040808@tmr.com \
--to=davidsen@tmr.com \
--cc=akpm@osdl.org \
--cc=davej@redhat.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;
as well as URLs for NNTP newsgroup(s).