As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label CPU. Show all posts

This morning, I noticed the system temperature was oddly low, only just above 40C. I didnt mind at first, but then I felt it seemed to run slower than before, which might just from confusion after I checked the frequencies from /proc/cpuinfo.

I had not looked at file for years, and I saw the frequency was fixed at 1833MHz and 1000MHz, two cores, respectively. So, I tried the ultimate fix, turning it off and on again, didnt work. I began to wonder if anything got updated recently, not the kernel nor any system/hardware stuff that I could remember.

At this point, I laughed before I knew there must be a setting wrong and for years, I had not realized that. So I went back to the power management in kernel configuration and found that I might have been using the wrong governor since 2012-08-27 as kernel 3.4 recommended ondemand governor according to ArchWiki.

That was 3.5 years ago.

i7tt is a nice CPU temperature monitor. It draws each core in line chart in Braille and groups all cores in a bar chart for overview, which uses different colors to indicate the temperature ranges.

There is only one command-line option for average period. It uses coretemp drivers sysfs interface to get the data.

i7tt was created by Marios Andreopoulos on 2015-08-19, written in Go with termui under the GPLv3, currently git-3335dbb (2015-11-20, post v1.03 (2015-08-28)).

I came across Glances, a system monitoring program written in Python, as its name hints, it enables you to review system information, status, or resource usage in just a few glances. As you can see from the screen shot above, all information in one screen.

  • CPU: Glances probably the only few programs which display the details of what CPU spends time on rather than just a simple percentage of utilization. How much time it's idling or waiting for IO? For example, iowait is an useful information, when disk is busy, more or less it could slow down the system for different reasons and by reading iowait, you know some heavy IO activity is going on.
  • Load average: It's same as uptime gives, the load average of past 1, 5, and 15 minutes.
  • Memory and Swap: Like CPU, more detail is shown, such as buffered, cached, active, or inactive memory. Similar to free command output.
  • Network: Each interface's bandwidth usage, upload and download rates. You can press B to switch unit between bit/second and byte/second.
  • Disk I/O: Read/Write rates on partitions and devices. Not only physical storage devices but also optical devices.
  • Mount points: Similar information you get from df command, such as total size, used space, and available size.
  • Processes: Like htop or top, you can use keys to choose sorting fields.
Glances shows information as much as they can be fitted in terminal window size. You can turn off sections by keys, separately, if you don't need them.

It also support server mode, a client can use XML-RPC call to get the system information in JSON format. It's possible to write your own client if you don't like default text-based client or you can write a GUI or web interface to display the data. It supports Linux, Mac OS, and Windows, although no default client for Windows, it will only runs as server due to no curses module available on Windows platform.

Glances is only one-year-old, first released on December 4, 2011, there are many possibilities for improvements. For example, configuration file for colors or disabling sections by default. Also custom fields for processes, and the list can go on and on.

I was intrigued by its name when I first heard of it and the idea behind this program is useful and simple. You don't need to run several programs to get all information of a system. You can have everything on one screen, even status of multiple systems at same time with client/server mode and terminal multiplexer.

There was an incredible idea posted early this month in Linux kernel mailing list by Paul E. McKenney:

Although there have been numerous complaints about the complexity of
parallel programming (especially over the past 5-10 years), the plain
truth is that the incremental complexity of parallel programming over
that of sequential programming is not as large as is commonly believed.
Despite that you might have heard, the mind-numbing complexity of modern
computer systems is not due so much to there being multiple CPUs, but
rather to there being any CPUs at all.  In short, for the ultimate in
computer-system simplicity, the optimal choice is NR_CPUS=0.

This commit therefore limits kernel builds to zero CPUs.  This change
has the beneficial side effect of rendering all kernel bugs harmless.
Furthermore, this commit enables additional beneficial changes, for
example, the removal of those parts of the kernel that are not needed
when there are zero CPUs.

Who would have thought the solution is just that simple, zero CPUs. All problems will be gone as long as you have zero CPUs. No more unexpected bugs and developers wouldn't be stuck in complex of design. Zero is the one.

If you think that's ultimately optimal choice, then you are mistaken. Less than five hours later, Eric Dumazet brought up another concept which makes the entire kernel ascends to completely different and extraordinary level. No one has foreseen it until now:

Hmm... I believe you could go one step forward and allow negative values
as well. Antimatter was proven to exist after all.

Hint : nr_cpu_ids is an "int", not an "unsigned int"

Bonus: Existing bugs become "must have" features.

Of course there is no hurry and this can wait 365 days.

Using opposite to negate the disadvantages of having CPUs. As if matter-antimatter collides, which results the energy generated much more than by options we have today. We may have several orders of magnitude greater than currently most powerful CPU's processing capability.

Lucky for Linux user, this technology doesn't need to wait for long. Less than 365 days to go. Since then, our Linux box will be able to do almost everything in a split of a second, which needs an hour or so at the moment.

No doubt that the major OS developers will try to patent it. Someone with good heart has to prevent such thing from happening and allows everyone to use this new concept freely. This is the future of human beings, not just computing, we can not afford being ruined by corporations.