Archive for November, 2010

CPU Frequency Scaling

Friday, November 19th, 2010

I compiled my own kernel for the first time since high school last night. And it felt good. And now, I have CPU Frequency Scaling working. I probably could have made it work before because it looked like everything was built as modules, but I never got around to figuring out what I needed to load. So, I just built in what I knew I needed. The kernel compile took 3:18 (3 minutes) on the stock kernel, and running the build again using the new kernel was slightly slower at 3:48. If I get time, I’d like to see if I can get that down… although I would need to save the specific configuration to have a meaningful comparison. However, as long as the build time is going down I should be approaching faster, because if it’s due to less things being compiled the kernel will be leaner. A leaner kernel leaves more precious CPU cache for the processes. Of course, modules break this theory in that removing the compilation of unneeded modules speeds up the compile without speeding things up at all.

Anyway, back to frequency scaling. My CPU supports 4 frequencies, 800 MHz, 2.2, 2.7, 3.4 GHz. And each core can me set independently. Sweet. It turns out that when all 4 cores are at 800 MHz, I get an audible buzz that is rather annoying. Shame on you AMD. Setting any one of the processors to the next higher frequency eliminates the problem, but I want to use the ondemand governor. What ondemand does is increase the frequency when the CPU load is high. I think it can even skip for example from 800 MHz to straight to 3.4 if it detects the load rising quickly enough. Well, it turns out that I can set a minimum frequency per core. So, by running

sudo su -c ‘echo 2200000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq’

I set the minimum frequency to 2.2 GHz on the fourth CPU. So now I’ve got 3 at 800 MHz and one at 2.2 GHz. No whiny processors, and much power savings over 4 cores blasting noops at 3.4*10^9 times per second. Not the ideal of replacing 4.25 noops with 1, because of AMD’s failure to thoroughly test the acoustic consequences of their design, but still we are reducing 2.96 to 1 at idle.

Circular Logic

Tuesday, November 16th, 2010

Ask a logician about circular logic and they will tell you it is a fallacy. But, to me, this is an oversimplification. It holds as a fallacy when used in isolation, but when there are feedback loops, circular logic can indeed be used to produce matter from the illusions created by circular logic, or circular reasoning as Wikipedia calls it. Of course, the logicians are right in that circular logic is illusory, but that does not make it useless. Math has imaginary numbers already, why not formalize imaginary logical structures? Society has been running off half baked theories that are consistently revised since we started chasing our crazy half baked ideas. And it has clearly led to great advances. But, knowing that today’s brilliant idea will be tomorrows useful, but discarded broken theory, shouldn’t we attempt to understand the phenomenon? There are small errors in everything, and engineers design by just allowing enough tolerance. But knowing how much tolerance is needed is considered an art, and many would argue it can’t really be a hard science. If you look at Gödel’s work with the glasses of illusions as false, they have a point. Any theory consistent with existing theories will not “complete” (finish, as in “we’ve solved it, there are no more theories”) all the theories, as long as the set of theories is past a certain level of complexity. And that level of complexity exists everywhere. Out best hope is to predict as much as we can, and if a hurricane hits or lightening strikes, all bets are off. Butterflies are flapping their wings all the time. Sure, what we know works 99.999% of the time, but that’s still 1.33 days a year. Luckily, there’s a lot of things with even higher reliability, but machines breaking and needing repaired, or rebooted is common. 99.99999…% wears out pretty quickly when a processor is operating at 3 GHz (3,000,000,000 operations per second), or 94,670,208,000,000,000 in a year. That’s right, 94 quadrillion times. To get that down to 2.59 failures per day you need 99.9999999999999% reliability. I think you get the point. However, when Gödel’s work is looked at with consideration of the power of shared illusions, and his proof that there will always be a true statement that can not be proved, one can see a justification for accepting the premise of circular logic in a limited capacity. Much theory is fairly secure in predicting results, but theories are just that, theories. Sure, they all break down at some point, but when the illusion fails, the products of the illusion still remain.

Fire as heat + electricity

Sunday, November 14th, 2010

What we need is more efficient natural gas usage in the home, used for primarily for heating air/water, and cooking.  Possibly even generating electricity.  If there was a burner turning a steam turbine for electricity, the used steam could be used to heat water on the return to the boiler.  The water could provide hot water for showers, and also heating in the winter… mini radiator + fan at air ducts.  Of course, you have to be sure the plumbing can handle the extra flow of water needed to heat the air.  Good insulation on hot water pipes would be critical.

Of course, this would work just as well with any heat source, as long as it can boil enough water.  We want to maximize fuel BTUs but minimize cost and environmental impact.  We can also experiment with other forms of “steam.”  All liquids expand as they evaporate… For example, alcohol would evaporate at a lower temperature, requiring less heat to get things moving.  However, we would have to consider the mass density of the vapor.  We want to use whatever fluid -> vapor expands the most for the BTU level we will have, while also meeting any requirements for minimum temperature.  For example, if all of the data centers used water cooling, they could reduce the energy usage from all those fans to one water pump per rack, and that hot water could evaporate alcohol (or something else) to run a small steam engine to turn a generator.  By recouping the heat energy, you may even be able to power the pump, effectively neutralizing your cooling costs.

Also, recovering the heat from cooling devices (think freezers and ACs) would not only recover some electricity, but in the case of a freezer, could lower the load on the AC in the summer.
If it turns out that water (or something with an even higher vaporization point) is the best material, a natural gas flame could “finish” the material to the right temperature in a boiler.  Anyway, it seems like it may be better than what we’re doing now.  Just an interesting idea I would love to see it work.