From the memory usage related lines in top:
Mem: 16432032k total, 16340144k used, 91888k free, 21736k buffers
Swap: 18481144k total, 1112k used, 18480032k free, 15624488k cached
Let's ignore the swap. Total memory equals the sum of used and free memory. Used, on the other hand, is the sum of "really used by applications" and cached and buffers. So, in your case goes like this:
- Mem = 16432032k = 16340144k + 91888k;
- "Really used by applications" = Used - (cached + buffers) = 16340144k - (15624488k + 21736k) = 693920k.
The other 15.5 GB are cached. This improves performance. However, in the very moment an application requires part of the cached memory it is immediately given to it. You will notice this if you run some memory hungry application and monitor top
.
Setting the online status of the CPU core just tells the process scheduler to not use that core for any processes. On a hardware level, the core is simply sitting idle (doing NOP
s), but still powered. While this will save power, it won't save nearly as much power as putting the computer to sleep. Why?
Well, your motherboard, CPU, and GPU are all still running! When you put the computer to sleep, all of these components are literally unpowered, and just enough power to keep your RAM alive is used (on the order of a couple watts).
Again, while I agree it will save power, even shutting off half of your CPU cores may halve the power consumption of the processor (although in reality, you may only save 30-40% since those cores still need to sit idle), but this is far from the only component in the system using power. Even if you save 50W by doing this, you're entire computer is still drawing far more power than mere watts in sleep mode.
Final thoughts: While I agree this is a great idea in practice, this is also why many CPU manufacturers include dynamic frequency scaling (Intel's "Speed Step"), with support for Linux. You may yield better overall performance, as well as power efficiency, by setting these frequencies more appropriately for your needs. This can be done in both hardware (BIOS settings), as well as software (the Linux kernel allows you to modify some CPU parameters, see the link I posted above or this website for details).
This works, because the following is the generic equation for power consumption of a CMOS circuit:
P = CV2f, where C = capacitance (assume fixed), V = voltage, and f = frequency.
Thus, dividing the frequency by 2 will half the original power consumption. Dividing the voltage by 2 will reduce power consumption to 1/4 the original.
Best Answer
"uninterruptible sleep" means that the process is waiting on I/O (disk operations for example). But given that the CPU is running the process, even though it isn't doing work, the CPU is still "stuck" waiting for it to complete the io, so it can get on with something else - to schedule another task. So this consumes 100% of cycles of the CPU when the process is in D mode.
So it is in sleep mode, in than that it isn't doing any CPU work, but is uninterruptible which means the CPU can't do anything else.
In a multi-core system, the other cores are available for other tasks.