FreeBSD 9.0-RELEASE on PowerMac Dual G5
nwhitehorn at freebsd.org
Sun Feb 19 18:47:37 UTC 2012
On 02/18/12 18:56, Kevin H. Patterson wrote:
> I've taken an interest lately in running FreeBSD on the powerpc64
> architecture. I have access to a dual 2.5 GHz PowerMac G5, and I've
> successfully got FreeBSD 9.0-RELEASE up and running on it.
> Only one thing seems amiss so far... it feels *very* SLOW. I realize
> this is an older machine, but it feels much too slow for a dual G5.
> Compiling seems to take forever, and top shows ~50% or more "system"
> CPU usage when doing almost anything other than sitting idle.
> Furthermore, the system fans never speed up, but run at the lowest
> speed even when the system is under full load. I have tried both
> enabling and disabling powerd support, with no effect.
> For a quick sanity check, I installed ubench (0.32) from ports. The
> numbers were quite disappointing: 109870 CPU / 50527 MEM
> multiprocessor, and 55433 CPU / 30863 MEM single-processor.
> For comparison, I ran ubench (0.32 from MacPorts) under Mac OS X
> 10.5.8 on the same machine. This time, the fans do ramp up, and the
> numbers are *WAY* better: 277207 CPU / 317119 MEM multi-processor,
> and 141021 CPU / 284113 MEM single-processor.
The very nearly a factor of two is suspicious. Can you check in dmesg if
your reported CPU speed is what you think it should be? Some G5s boot
with their CPUs at half-frequency. On most 970MP and 970FX systems, you
can change the CPU with a sysctl (cpufreq(4)), but on others we don't
have a driver yet. The fan speed may not mean anything -- the fans are
software managed and FreeBSD uses a different algorithm than OS X.
> As you can see, all is not well. I am wondering what is slowing
> FreeBSD down on this machine. I have tried both GENERIC and my own
> kernel config. It feels like the CPU and or bus speed is clocked down
> perhaps to the most energy-saving level. Maybe this is where
> openfirmware leaves it after boot? Also interesting is to note the
> drastic *single-processor* ubench difference between macosx and
> freebsd. To me this looks like a low clock-speed smoking gun.
> I also noticed that the kernel build includes flags like -msoft-float
> and -mno-altivec...
These flags just affect internal kernel state-keeping and don't affect
anything (since the kernel doesn't use any floating point, for
instance). OS X and Linux are built the same way, and FreeBSD on x86 is
built with equivalent flags.
> I am interested in any build or config tweaks that might be in order.
> I am also more than happy to debug and get to the bottom of this. Any
If the CPU speed is in fact right, it's possible you've just run into
limitations of our kernel. PowerPC64 is a new platform, and the emphasis
was more to get it working than to optimize things (this is also mostly
true of 32-bit PPC). It's possible there are some large bottlenecks in
the VM system. Straight numerical code (something like sha256 -t) is not
affected by such problems, but things that involve spawning and reaping
large numbers of processes might be. Andreas Tobler
(andreast at freebsd.org) was doing some work recently on kernel profiling,
and I'm sure would appreciate some help identifying hotspots.
More information about the freebsd-ppc