Does Ubuntu support Core Parking?

3,332

Solution 1

For the time being, I do not have a clear answer for this, however it is obvious that the linux Kernel is using some energy saving mechanisms.

However, doing some quick research around, I quickly realised that the most recent Linux kernels make use of a feature called ACPI which is an acronym for Advanced Configuration and Power Interface.

What the ACPI is doing:

the Advanced Configuration and Power Interface (ACPI) specification provides an open standard for device configuration and power management by the operating system.

via Wikipedia.

Basically the ACPI allows for control of different CPU states, to allow for better power management.

Different ACPI CPU-states:

CPU C-States (power management)

Basically, there is probably nothing that you have to worry about concerning the CPU "C states". These are automatically controlled by the kernel+ACPI system taking into consideration current system load. (CAVEAT: check out the note about AMD Athlon and Duron processors below). The ACPI code in the newer (2.6+) kernels automatically puts your CPU to sleep when there is idle time (note: this does not change the CPU frequency. That is controlled by "P states" - see below).

The only thing to realize is that your system is completely "conscious" when the CPU is momentarily halted - you won't notice much of a difference. However, the power savings can be considerable. Just think of it as having your CPU taking thousands of "micro-naps" whenever it is idle.

CPU-T States (throttling)

These are very much like "C states" (the same HLT instruction is used), however the difference is that throttling is "forced by you" (like every 4th cycle is forced to be a sleep cycle, as opposed to the "C states" above which are automatically determined by the system load). Note that the frequency has NOT been changed... see the "P states" below.

CPU-P States (performance)

Many processors these days (especially laptops) can have the clock frequency actually slowed "on the fly". This adds up to huge power savings. Intel calls this "SpeedStep" and AMD calls it "Cool'n'Quiet" or "PowerNow". More generically these states are called "P states". You will almost certainly have to go into the BIOS and enable this feature for your CPU FIRST!

** Some consumption benchmarks:**

What are the power savings from the above CPU states? The following data is extracted from the AMD website. Consider an AMD 64 3400+/2200MHz with 1 MB of L2 cache. By the way, while I'm here, let me complain about the AMD naming convention. The number 3400+ doesn't mean jack squat. This is just AMD's way of saying that this processor "looks like" an Intel Pentium-4 running at 3400MHz. I guess this is their way of not losing marketshare. Here are the P and T state power consumption values (the C state is the same HLT instruction as the T state):

  • Performance State 0 (Fully Active) (2200MHz): 89 Watts
  • Performance State 1 (2000MHz): 70 Watts
  • Performance State 2 (800MHz): 35 Watts
  • Throttled (HLT instruction): 2.2 Watts

Some references for further reading

EDITS

[EDIT #1]: Googling around, I found some other posts in some forums too (OpenSuse forum seems to be relevant to what you seek) and found out that this is not that much of an issue for Linux as it is for windows and especially in gaming. I also dug up some information in two mails (first one and second one [follow-up]) in the RedHat mailing lists that seems to be related. I am currently researching the information in it.

[EDIT #2]: I have researched the issue a bit, and I am getting more and more certain that there is not a core parking mechanism in Linux, unless there is one the ACPI that I am unaware of. Some interesting findings are some pieces of software that allow for direct manipulation of the cpu and the processes run on it, like cpuset, numactl and last but not least, CPUfreq. Will continue with my research.

Solution 2

There's an article here mentioning that core parking relates to setting cores to advance c-states to save power. c-states are set with the halt instruction. As NlightNFotis mentions this is done using linux's support for ACPI.

You may be able to get some more information about the states into which your cores are put by linux with the powertop (sudo apt-get install powertop) open source program written by Intel. If your hardware supports various c-states it should be able to tell you what percentage of time your cores are put into these reduced-power states by Ubuntu Linux. See below. The higher number the c-state the more power that is saved.

It provides much more information as well.

Also, like Windows, when there is work to do Linux can adjust the frequency at which the cores run depending upon the amount of demand, desire to save power, etc.

My laptop doesn't support c-states, though it can be suspended. A little Acer we have with an Atom processor does support them, as you can see below.

enter image description here

Share:
3,332

Related videos on Youtube

Lynx
Author by

Lynx

Updated on September 18, 2022

Comments

  • Lynx
    Lynx over 1 year

    I am using Laravel 4 and I am trying to pass information if the user IS logged in. If the user is not logged in I want to display something else in plain text

    BookController

    public function showIndex() { 
    
        $user_information = UsersInformation::find(Auth::user()->id);
    
        return View::make('book.index', array('pageTitle' => 'Book your appointment',  'user_information' => $user_information));
    }
    

    I tried adding isset() right above the $user_information variable but got this error message

    Cannot use isset() on the result of a function call 
       (you can use "null !== func()" instead)
    

    Index.blade.php

            @if (isset($user_information->first_name))
               <p> You already have the 1 step complete let's move on to the second step!</p>
            @else
               <p>first step. let's create a login name and let's get to know you better</p>
            @endif
    

    added the isset here for the first name because if they access their account they must provide a first name.

    I attempted to add the isset as follows:

                 if (isset(UsersInformation::find(Auth::user()->id))) {
                    $user_information = UsersInformation::find(Auth::user()->id);
                 }
    

    I of course tried using the recommended syntax but then once again got the 'Trying to get property of a non object' error

    • NlightNFotis
      NlightNFotis over 11 years
      Great Question!
    • Sverri M. Olsen
      Sverri M. Olsen over 10 years
      Show us the actual code where you use isset(), and any other relavant code as well.
    • Lynx
      Lynx over 10 years
      I edited my question. Thanks!
  • Iffi
    Iffi over 11 years
    I think some Android devices can disable one or more cores. Not sure if this is managed directly by the hardware or the kernel though.
  • Lynx
    Lynx over 10 years
    Looks like that did it. Thanks!