Subject: Re: Per-CPU objects (needed for SMP)
To: Tonnerre <tonnerre@thundrix.ch>
From: Frank Kardel <Frank.Kardel@Acrys.COM>
List: tech-kern
Date: 06/01/2005 22:39:17
> Salut,
>
> I'm currently trying to improve SMP support, whereas my next task is to
> get softinterrupts off the BKL. Ideally, one would be able to run one
> softint handler per CPU, which I can only implement if I can store
> per-CPU data.
>
> So:
>
> 1. is there an implementation for per-CPU data out there yet, or

/usr/src/sys/arch/i386/i386/cpu.c gives the impression that there are
local cpu structures.

> 2. is there an easy way to determine the CPU number one's running on in
>    SMP scenarios?
I'd assume that to be reasonably simple (I haven't scanned for that code
though).

In 1989 my colleage and I parallelized an m68k SYSVR3 using monitors and an
splx() implementation that allowed for parallel interrupt processing in
non-conflicting drivers without having source adjustments to the driver
code. Executing in top and bottom half of the driver (interrupt supporting
monitor) with two different cpus was possible also.

We mapped the private CPU structure at a fixed address have very simple
access to private variables.

If somebody is interested in those concepts I could dig the details out
again.

Frank