2003-02-10 15:28:48

by James Buchanan

[permalink] [raw]
Subject: SMP-Linux

Hello List,

I am new to this so please forgive this post if it seems stupid.

Is it possible to design a SMP-Linux kernel with architecture
independent SMP support, for example, like the VFS provides an
interface to specific filesystems, the "VSMP" can provide an
architecture independent way to support SMP? There can be a function
that does the spinlock stuff and underneath is a machine dependent
implementation (this is already done for x86, what about other MP
capable architectures?), and same for the scheduler. Lots of other
stuff like TLB issues and so on would have to be taken care of as
well. I'm no expert on SMP so I don't really know if a "virtual" SMP
support is possible in the way I am describing it.

Is this an interesting idea to anyone? I expect it has been thought
of before, but maybe it needs a hell of a lot of research to even
begin thinking about it seriously. If anyone is interesting in really
thrashing this out off list (or on list, but is this considered bad
netiquette?), please mail me. I am very interested in discussing this
in horrid detail :-)

When I buy my SMP system, I plan to hack in the first stages of such
"VSMP" support if it's feasible.

Again, I don't really know what I'm doing so please go easy on me :-)
I am still in the early stages of soaking up the stuff in the Intel
CPU programming manuals.

Thanks!
James


2003-02-10 15:59:07

by John W. M. Stevens

[permalink] [raw]
Subject: Re: SMP-Linux

On Tue, Feb 11, 2003 at 02:36:48AM +1100, James Buchanan wrote:
> Is it possible to design a SMP-Linux kernel with architecture
> independent SMP support, for example, like the VFS provides an
> interface to specific filesystems, the "VSMP" can provide an
> architecture independent way to support SMP?

Why stop there? Why not make a complete hardware abstraction layer?

Oh, by the way, I have two words for you:

DUCK!

:-)

> There can be a function
> that does the spinlock stuff and underneath is a machine dependent
> implementation (this is already done for x86, what about other MP
> capable architectures?), and same for the scheduler. Lots of other
> stuff like TLB issues and so on would have to be taken care of as
> well. I'm no expert on SMP so I don't really know if a "virtual" SMP
> support is possible in the way I am describing it.

What you are describing sounds very much like a Virtual Machine.

Been there, done that, and it does have some benefits.

Good Luck,
John S.

2003-02-10 16:08:19

by James Buchanan

[permalink] [raw]
Subject: Re: SMP-Linux

> Why stop there? Why not make a complete hardware abstraction layer?

NetBSD has - hasn't it? Take a look!

> Oh, by the way, I have two words for you:
>
> DUCK!
>
> :-)

Uh oh ... ;-)

> What you are describing sounds very much like a Virtual Machine.
>
> Been there, done that, and it does have some benefits.

Yes, a HAL, very much, but not really a VM, only a very thin layer of
architecture-nuturalness. Very thin. The trickery I have learnt from
the NetBSD project is that it has some very clever glue code below
this HAL. I suppose to maintain acceptable performance levels. Then
again the goals of NetBSD and Linux are different in some respects,
Linux likes raw speed and was originally only for the x86 and NetBSD
likes portability above that.

So I suppose my experiment will never really take off, but could have
some interesting results!

--
James

2003-02-20 17:40:27

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: SMP-Linux

On Fri, 2003-02-21 at 06:45, James Buchanan wrote:
> > Well... how do you think linux actually works ? Did you bother
> > _reading_ the code before proposing to do something that is
> > basically already there ? :)
>
> Ah! No, not really. It is not a complete HAL. And no, I didn't read
> all the source, I am not sure if anyone can do that very
> successfully. I did know there was SMP, yup. Seen it all...
>
> The sources are very hard to read! Poor design/no design, lack of
> documentation, shit documentation from programmers that can't spell,
> etc. ;-)

Hrm... In your previous mail, you talked about doing a thin layer
that gives efficiency. That's exactly what it is.

Honestly, you can find crappy code in linux here or there, that's
not the problem. I doubt you'll be able to backup your claims very
long regarding this specific one which is SMP, especially in 2.5
kernels.

But feel free to prove me wrong by actually doing something, then
showing us numbers !

Ben.

2003-02-20 17:26:48

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: SMP-Linux

On Mon, 2003-02-10 at 17:16, James Buchanan wrote:

> Yes, a HAL, very much, but not really a VM, only a very thin layer of
> architecture-nuturalness. Very thin. The trickery I have learnt from
> the NetBSD project is that it has some very clever glue code below
> this HAL. I suppose to maintain acceptable performance levels. Then
> again the goals of NetBSD and Linux are different in some respects,
> Linux likes raw speed and was originally only for the x86 and NetBSD
> likes portability above that.
>
> So I suppose my experiment will never really take off, but could have
> some interesting results!

Well... how do you think linux actually works ? Did you bother
_reading_ the code before proposing to do something that is
basically already there ? :)

Ben (happily running SMP on PowerPC architecture).

Ben.