public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Hafting <helgehaf@idb.hist.no>
To: "Grover, Andrew" <andrew.grover@intel.com>, linux-kernel@vger.kernel.org
Subject: Re: lilo vs other OS bootloaders was: FreeBSD makes progress
Date: Wed, 05 Sep 2001 10:03:03 +0200	[thread overview]
Message-ID: <3B95DC37.A7FF9966@idb.hist.no> (raw)
In-Reply-To: <4148FEAAD879D311AC5700A0C969E89006CDE0E2@orsmsx35.jf.intel.com>

"Grover, Andrew" wrote:
> 
> > >  ANdreas Dilger wrote:
> > > > Win2K even abstracts all SMP/UP code into a module (the
> > HAL) and loads this
> > > > at boot, thus using the same kernel for both.
> >
> > >     the only possibility of this shows how ugly is SMP in win2k...
> >
> > Not necessarily. More likely the difference between SMP and
> > UP is marketing-only and both have the overhead of SMP
> > locking, etc..
> 
> No, they don't do this by running an SMP kernel on UP, they do it by
> abstracting functions that care about SMP into another module.
> 
> Here's Linux:
> 
> Drivers (SMP agnostic)
> Kernel (SMP/UP specific)
> 
Linux modules are not agnostic, they too are SMP specific.
Because a module may use spinlocks.

Modules should really be compiled with the kernel.  They are an
intersting way to save some memory, they are not a way of
distributing drivers or anything like that.

> I'm not advocating anything similar for Linux, I'm just saying it's an
> interesting thought experiment - what if the SMP-ness of a machine was
> abstracted from the kernel proper? How much of the kernel really cares, or
> really *should* care about SMP/UP?
> 
> For one thing, it would get rid of the hundreds of "#ifdef CONFIG_SMP"s in
> the kernel. ;-)

You would also get rid of performance.  The agnostic kernel would be
slower than simply running the SMP kernel on UP.

Here's why:
You can easily make an "agnostic kernel & modules" by changing the
spinlocks to function calls.  Then you'll provide a null stub call site
for running UP, and the real spinlock code for running SMP.

Unfortunately, this gives the overhead of a function call, both for SMP
and for UP.  This overhead is usually _bigger_ than the overhead of a
inlined spinlock.

So if you aim for a simple distribution - go for SMP.  The loss on UP is
small. I have haerd of cases when the SMP setup code fails on UP
when smp hardware is missing.  You could of course work to eliminate
that.

Helge Hafting

  parent reply	other threads:[~2001-09-05  8:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-04 21:52 lilo vs other OS bootloaders was: FreeBSD makes progress Grover, Andrew
2001-09-05  1:51 ` David S. Miller
2001-09-05  8:03 ` Helge Hafting [this message]
2001-09-05 14:26 ` Horst von Brand
2001-09-11 22:48 ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2001-09-05 21:18 Grover, Andrew
2001-09-05 22:11 ` Alan Cox
2001-09-05 22:13 ` Tim Hockin
2001-09-01 14:55 Samium Gromoff
2001-09-01 12:03 ` Peter Wächtler
2001-09-01 12:39   ` Alan Cox
2001-09-01 14:10 ` Rik van Riel
2001-08-31 21:49 Grover, Andrew
2001-08-31 22:40 ` Andreas Dilger
2001-08-31 22:50 ` Alan Cox
2001-09-01 15:50   ` Jamie Lokier
2001-09-08 17:55   ` Eric W. Biederman
2001-09-08 18:55     ` H. Peter Anvin

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=3B95DC37.A7FF9966@idb.hist.no \
    --to=helgehaf@idb.hist.no \
    --cc=andrew.grover@intel.com \
    --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