linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Mielke <mark@mark.mielke.cc>
To: Bill Davidsen <davidsen@tmr.com>
Cc: Larry McVoy <lm@bitmover.com>,
	Peter Waechtler <pwaechtler@mac.com>,
	linux-kernel@vger.kernel.org, ingo Molnar <mingo@redhat.com>
Subject: Re: [ANNOUNCE] Native POSIX Thread Library 0.1
Date: Mon, 23 Sep 2002 18:35:29 -0400	[thread overview]
Message-ID: <20020923183529.A26887@mark.mielke.cc> (raw)
In-Reply-To: <Pine.LNX.3.96.1020923152135.13351C-100000@gatekeeper.tmr.com>; from davidsen@tmr.com on Mon, Sep 23, 2002 at 03:48:58PM -0400

On Mon, Sep 23, 2002 at 03:48:58PM -0400, Bill Davidsen wrote:
> On Mon, 23 Sep 2002, Larry McVoy wrote:
> > Sure, there are lotso benchmarks which show how fast user level threads
> > can context switch amongst each other and it is always faster than going
> > into the kernel.  So what?  What do you think causes a context switch in
> > a threaded program?  What?  Could it be blocking on I/O?  Like 99.999%
> > of the time?  And doesn't that mean you already went into the kernel to
> > see if the I/O was ready?  And doesn't that mean that in all the real
> > world applications they are already doing all the work you are arguing
> > to avoid?
> Actually you have it just backward. Let me try to explain how this works.
> The programs which benefit from N:M are exactly those which don't behave
> the way you describe. Think of programs using locking to access shared
> memory, or other fast resources which don't require a visit to the kernel.
> It would seem that the switch could be done much faster without the
> transition into and out of the kernel.

For operating systems that require cross-process locks to always be
kernel ops, yes. For operating systems that provide _any_ way for most
cross-process locks to be performed completely in user space (i.e. FUTEX),
the entire argument very quickly disappears.

Is there a situation you can think of that requires M:N threading
because accessing user space is cheaper than accessing kernel space? 
What this really means is that the design of the kernel space
primitives is not optimal, and that a potentially better solution that
would benefit more people by a great amount, would be to redesign the
kernel primitives. (i.e. FUTEX)

> Looking for data before forming an opinion has always seemed to be
> reasonable, and the way design decisions are usually made in Linux, based
> on the performance of actual code. The benchmark numbers reports are
> encouraging, but actual production loads may not show the huge improvement
> seen in the benchmarks. And I don't think anyone is implying that they
> will.

You say that people should look to data before forming an opinion, but
you also say that benchmarks mean little and you *suspect* real loads may
be different. It seems to me that you might take your own advice, and
use 'real data' before reaching your own conclusion.

> Given how small the overhead of threading is on a typical i/o bound
> application such as you mentioned, I'm not sure the improvement will be
> above the noise. The major improvement from NGPT is not performance in
> many cases, but elimination of unexpected application behaviour.

Many people would argue that threading overhead has been traditional quite
high. They would have 'real data' to substantiate their claims.

> When someone responds to a technical question with an attack on the
> question instead of a technical response I always wonder why. In this case
> other people have provided technical feedback and I'm sure we will see
> some actual application numbers in a short time. I have an IPC benchmark
> I'd like to try if I could get any of my test servers to boot a recent
> kernel :-(

I've always considered 1:1 to be an optimal model, but an unreachable
model, like cold fusion. :-)

If the kernel can manage the tasks such that they can be very quickly
switched betweens queues, and the run queue can be minimized to
contain only tasks that need to run, or that have a very high
probability of needing to run, and if operations such as locks can be
done, at least in the common case, completely in user space, there
is no reason why 1:1 could not be better than M:N.

There _are_ reasons why OS threads could be better than user space
threads, and the reasons all relate to threads that do actual work.

The line between 1:1 and M:N is artificially bold. M:N is a necessity
where 1:1 is inefficient. Where 1:1 is efficient, M:N ceases to be a
necessity.

mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/


  parent reply	other threads:[~2002-09-23 22:32 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-22 18:55 [ANNOUNCE] Native POSIX Thread Library 0.1 Peter Waechtler
2002-09-22 21:32 ` Larry McVoy
2002-09-23 10:05   ` Bill Davidsen
2002-09-23 11:55     ` Peter Waechtler
2002-09-23 19:14       ` Bill Davidsen
2002-09-29 23:26         ` Buddy Lumpkin
2002-09-30 14:54           ` Corey Minyard
2002-09-23 15:30     ` Larry McVoy
2002-09-23 19:44       ` Olivier Galibert
2002-09-23 19:48       ` Bill Davidsen
2002-09-23 20:32         ` Ingo Molnar
2002-09-24  0:03           ` Andy Isaacson
2002-09-24  0:10             ` Jeff Garzik
2002-09-24  0:14               ` Andy Isaacson
2002-09-24  5:53             ` Ingo Molnar
2002-09-24 20:34             ` David Schwartz
2002-09-24  7:12           ` Thunder from the hill
2002-09-24  7:30             ` Ingo Molnar
2002-09-23 22:35         ` Mark Mielke [this message]
2002-09-23 19:59       ` Peter Waechtler
2002-09-23 20:36         ` Ingo Molnar
2002-09-23 21:08           ` Peter Wächtler
2002-09-23 22:44             ` Mark Mielke
2002-09-23 23:01               ` Bill Huey
2002-09-23 23:11                 ` Mark Mielke
2002-09-24  0:21                   ` Bill Huey
2002-09-24  3:20                     ` Mark Mielke
2002-09-23 23:57           ` Andy Isaacson
2002-09-24  6:32             ` 1:1 threading vs. scheduler activations (was: Re: [ANNOUNCE] Native POSIX Thread Library 0.1) Ingo Molnar
2002-09-25  3:08               ` Bill Huey
2002-09-24 18:10             ` [ANNOUNCE] Native POSIX Thread Library 0.1 Christoph Hellwig
2002-09-23 21:32       ` Bill Huey
2002-09-23 21:41       ` dean gaudet
2002-09-23 22:10         ` Bill Huey
2002-09-23 22:56         ` Mark Mielke
2002-09-24 10:02       ` Nikita Danilov
2002-09-23 21:22     ` Bill Huey
2002-09-23 21:03 ` Bill Huey
2002-09-24 12:03   ` Michael Sinz
2002-09-24 13:40     ` Peter Svensson
2002-09-24 14:20       ` Michael Sinz
2002-09-24 14:50         ` Offtopic: (was Re: [ANNOUNCE] Native POSIX Thread Library 0.1) Peter Svensson
2002-09-24 15:19           ` Mark Veltzer
2002-09-24 17:29             ` Rik van Riel
2002-09-25 18:57               ` Mark Mielke
2002-09-25 19:04                 ` Rik van Riel
2002-09-25 19:29                   ` Mark Veltzer
2002-09-25 19:23                     ` Rik van Riel
2002-09-24 16:31           ` Rik van Riel
2002-09-24 18:49             ` Michael Sinz
2002-09-24 19:12               ` PATCH: per user fair scheduler 2.4.19 (cleaned up, thanks hch) (was: Re: Offtopic: (was Re: [ANNOUNCE] Native POSIX Thread Library 0.1)) Rik van Riel
2002-09-24 20:19 ` [ANNOUNCE] Native POSIX Thread Library 0.1 David Schwartz
2002-09-24 21:10   ` Chris Friesen
2002-09-24 21:22     ` Rik van Riel
2002-09-24 21:35       ` Roberto Peon
2002-09-24 21:35       ` Chris Friesen
2002-09-25 19:02     ` David Schwartz
2002-09-24 23:16   ` Peter Waechtler
2002-09-24 23:23     ` Rik van Riel
2002-09-25 19:05     ` David Schwartz
     [not found] <987738530@toto.iv>
2002-09-24  2:48 ` Peter Chubb
2002-09-24  3:37   ` Mark Mielke
  -- strict thread matches above, loose matches on Subject: below --
2002-09-23 16:36 Matthias Urlichs
2002-09-20  7:46 Joerg Pommnitz
2002-09-20  0:41 Ulrich Drepper
2002-09-20  0:51 ` William Lee Irwin III
2002-09-20  1:35   ` Ulrich Drepper
2002-09-20  1:42     ` William Lee Irwin III
2002-09-20  1:56 ` Larry McVoy
2002-09-20  2:01 ` Rik van Riel
2002-09-20  2:15   ` Benjamin LaHaise
2002-09-20  2:40     ` Dave Hansen
2002-09-20  2:47     ` William Lee Irwin III
2002-09-20  2:17   ` Larry McVoy
2002-09-20  2:24     ` Rik van Riel
2002-09-20  2:32       ` Ulrich Drepper
2002-09-20  6:01       ` Linus Torvalds
2002-09-20  8:02         ` Ingo Molnar
2002-09-20  2:23   ` Anton Blanchard
2002-09-20  9:53 ` Padraig Brady
2002-09-20 13:28   ` Robert Love
2002-09-20 16:01     ` Bill Davidsen
2002-09-20  9:54 ` Adrian Bunk
2002-09-20 10:53   ` Ingo Molnar
2002-09-20 19:04   ` Ulrich Drepper
2002-09-20 23:06     ` J.A. Magallon
2002-09-20 23:33       ` Ulrich Drepper
2002-09-20 23:42         ` J.A. Magallon
2002-09-20 10:20 ` Bill Huey
2002-09-20 10:47   ` Ingo Molnar
2002-09-20 12:06     ` Bill Huey
2002-09-20 16:20       ` Ingo Molnar
2002-09-20 21:50         ` Bill Huey
2002-09-20 22:30           ` dean gaudet
2002-09-20 23:11             ` Bill Huey
2002-09-21  3:38               ` dean gaudet
2002-09-21  4:01                 ` Bill Huey
2002-09-21  5:06                   ` Ingo Molnar
2002-09-20 23:45           ` Bill Huey
2002-09-21  4:58             ` Ingo Molnar
2002-09-22  2:51               ` Bill Huey
2002-09-21  4:48           ` Ingo Molnar
2002-09-22  1:38             ` Bill Huey
2002-09-22 13:38           ` Bill Davidsen
2002-09-22 18:41             ` Eric W. Biederman
2002-09-22 22:13               ` dean gaudet
2002-09-26 17:21                 ` Alan Cox
2002-09-23  0:11               ` Bill Huey
2002-09-24 16:07                 ` Eric W. Biederman
2002-09-24 23:21                   ` Bill Huey
2002-09-25  3:06                     ` Eric W. Biederman
2002-09-23 21:12             ` Bill Huey
2002-09-20 10:35 ` Luca Barbieri
2002-09-20 11:19   ` Ingo Molnar
2002-09-20 18:40     ` Roland McGrath
2002-09-20 21:21       ` Luca Barbieri
2002-09-20 12:37 ` jlnance
2002-09-20 16:42   ` Ingo Molnar
2002-09-24  0:40     ` Rusty Russell
2002-09-24  5:47       ` Ingo Molnar
2002-09-24  6:15         ` Rusty Russell
2002-09-20 15:43 ` Bill Davidsen
2002-09-20 16:15   ` Jakub Jelinek
2002-09-20 17:16     ` Bill Davidsen

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=20020923183529.A26887@mark.mielke.cc \
    --to=mark@mark.mielke.cc \
    --cc=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm@bitmover.com \
    --cc=mingo@redhat.com \
    --cc=pwaechtler@mac.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).