Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • CPU turbo
    Code Block
    # check turbo enabled or not 
    [user@machine ~]$ cpupower frequency-info|egrep 'Supported|Active'
        Supported: no
        Active: no
    
    # disbale turbo, where 0 means turbo is enabled and 1 means it is disabled.
    echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
    
    
    $ sudo x86_energy_perf_policy --turbo-enable 1
    
    $ cpupower frequency-info
       ...
      boost state support:
        Supported: yes <<-------
        Active: yes    <<-------
    
    $ sudo x86_energy_perf_policy --turbo-enable 0
    
    $ cpupower frequency-info
       ...
      boost state support:
        Supported: no <<-------
        Active: no    <<-------
    
    # cpu scheduling strategy (tuned)
    [user@machine ~]$  tuned-adm list



  • CPU freq
    Code Block
    [user@machine ~]$ sudo cpupower monitor # show cpu freq by cores, can check P-cores and E-cores as well
        |Nehalem                    || Mperf              
    CPU | C3   | C6   | PC3  | PC6  || C0   | Cx   | Freq 
       0|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       1|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       2|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       3|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       4|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       5|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       6|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       7|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       8|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
       9|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      10|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      11|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      12|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      13|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      14|  0.00|  0.00|  0.00|  0.00|| 99.70|  0.30|  3610
      15|  0.00|  0.00|  0.00|  0.00|| 99.50|  0.50|  3610
    
    # for the overclocked machine, the cpu always keep on a fixed freq even there is no load, otherwise, the freq variation amplitude is significant
    
    


  • core isolation
    Generally cpu is always automatically scheduling process to cores to keep load balance, however, if you prefer to allocate CPU resources manually, can do an isolation.
    • Code Block
      # rhel9
      
      grubby --update-kernel=ALL --args="selinux=0 net.ifnames=0 biosdevname=0 crashkernel=256M intel_idle.max_cstate=0 processor.max_cstate=1 idle=poll nohz_full=2-35 rcu_nocbs=2-35 isolcpus=managed_irq,domain,2-35 irqaffinity=0-1 ipv6.disable=1 pci=nommconf pcie_aspm=off"  # core isolation 
      
      cat /sys/devices/system/cpu/isolated # Fetch isolated core and check if the core has been isolated.
      
      [user@machine ~]$ cat /proc/cmdline
      BOOT_IMAGE=(mduuid/35e9369058f9a7598978718b5569aac6)/vmlinuz-5.14.0-362.8.1.el9_3.x86_64 root=/dev/mapper/vg0-root ro resume=/dev/mapper/vg0-swap rd.md.uuid=cb4beb04:bff85a77:a55d65d8:9e672ffc rd.lvm.lv=vg0/root rd.md.uuid=35e93690:58f9a759:8978718b:5569aac6 rd.lvm.lv=vg0/swap net.ifnames=0 biosdevname=0 crashkernel=256M intel_idle.max_cstate=0 processor.max_cstate=1 idle=poll nohz_full=1-7 rcu_nocbs=1-7 isolcpus=1-7 console=tty1 ipv6.disable=1 pci=nommconf pcie_aspm=off
      
      
      
      # isolcpus
      
      remove the cores from SMP balancing then can pin to a specific process.
      
      # nohz_full
      
      Specify which CPU cores can enter a completely tick free state under the premise of kernel 'CONFIG-NOHZ_SULL=y'.
      
      
      The nohz_full parameter will handle the timer loop of the specified CPU list in different ways. If the CPU is designated as nohz_full CPU and there is only one runnable task on the CPU, the kernel will stop sending the timer daemon to that CPU. Therefore, running the application may take more time, while service interruption and context switching may take less time.
      
      If you have a 100Hz tick, then 100 times per second, the operating system will wake up, check if any timers have expired, and if so, execute their actions before entering sleep mode again. On a tick less system, the operating system will check when the next timer expires and then sleep until that time, instead of waking up 100 times per second to see if there is anything that can be processed.
      
      
      When there is only one task running on the CPU, not sending scheduling clock interrupts to this CPU reduces scheduling clock interrupts and does not interrupt idle CPUs, thereby reducing power consumption and system jitter.
      
      # rcu_nocbs
      
      RCU (Read copy Update) is a high-performance locking mechanism that allows readers to access shared data protected by RCU without obtaining a lock (fast speed) in situations where there is more read and less write. But for write operations, it first copies a copy, then modifies the copy, and finally uses a callback mechanism to point the original data pointer to the modified data at the appropriate time, so the write speed is very slow.
      
      Rcu_nocbs=cpulist specifies that certain CPUs are callback free. When callback mechanism is needed, transfer the work to other CPUs to alleviate the load on the Nocb CPU.
      
      
      
  • HT (hyper-threading)
    Code Block
    grubby --args=nosmt --update-kernel=DEFAULT # disable SMT
    grubby --update-kernel=ALL --remove-args="nosmt" # enable SMT
    
    lscpu | grep -e Socket -e Core -e Thread # check HT status