Wednesday, July 29, 2015

Pimp My Quicksilver - Part IV:B CPU

As promised, this particular post will be short and sweet. First off, I have had to drop the upgraded CPU clock speed back down to 1.33 GHz as so far it seems to be offering the most stability with both operating systems. Research in that department continues.

However, I was still allowed to move forward with the jump to a 32-bit SMP kernel within Debian.  What follows is basically the 2 steps I had to take in order to do so.  Even then it is nothing outrageous.

1. Run the following command to search for the most current and appropriate 32-bit SMP PPC kernel within the Debian repositories.

sudo apt-cache search linux-image

This should return a list of about 3 different kernel image packages as well as the corresponding meta-packages and headers for each of them.  Look for the SMP image called linux-image-[insert version here]-powerpc-smp.  You do NOT want the powerpc64 version as no G4 PowerMac or CPU upgrade for it was ever 64-bit capable.  I have left the kernel image version out as it may vary over time.

2.  Install the SMP linux image.  Right now the current version on my Debian Jessie install is 3.16.0-4.

sudo apt-get install linux-image-3.16.0-4-powerpc-smp

After installing this image, I had no need to manually update my yaboot.conf file as that was done so automatically.  Would not hurt to double check though to make sure the default kernel is now your SMP one.

3.  Reboot

Reboot your machine to allow it to boot using the newly installed multiprocessor capable kernel.  Once you are logged in, there are multiple ways you can verify your system is now taking advantage of multiple CPUs, but I will cover the ones I am more familiar with.  The first command you can run will help you verify that your system is seeing both CPUs.

cat /proc/cpuinfo.

Here are the results of mine:


Okay.  Both CPUs are recognized, but are both being utilized by the running system? This is where the command line tool top can come in and provide this information.  In a terminal, simply type top and you should see a great deal of information and usage statistics about your running system.  You can type the 'h' key for help on different options you have at your disposal for arranging the layout of the information provided by top as well as what information is displayed.  We want to hit the '1' key to provide usage statistics on separate CPUs as can be seen from this screenshot:


Since both CPUs appear here with a % of use, we can be assured that both CPUs are being fully utilized by Debian.  Great.  How about we take it even one step further by looking at which CPU a particular process is running on?  That would provide even more assurance and give us an idea of how and what work is divided up amongst the two CPUs.  To do this, will need to use the ps command line tool.  This tool basically provides a snapshot of your system's running processes. Again, while in a terminal, type the following and hit Enter:

ps -eF

Look for the PSR column, which stands for processor.  In our case, the resulting number will either be a 0 or a 1 since we only have 2 CPUs and numbering always starts at 0 in computer science. Here is a screenshot hightlighting the command running on the QS.


If you are curious, the -e flag tells the system to include all processes and the -F flag stands for full format, which adds in some additional information to each listed process including the aforementioned PSR column.

That is it for this post.  I barely scratched the surface of what the ps and top tools are capable of, so I would encourage to explore them further.  All sorts of neat things are possible. The next (and last) post on the CPU upgrade will take a more in depth look at performance improvements in the system with more everyday tasks put to the test and some CPU spec comparisons.

1 comment: