CPU never goes under 11% load

Hi,

since last kernel update, my CPU never goes under 11% load and it warms a lot, looks like xorg server is getting the most of the load :

ps a :

    PID TTY      STAT   TIME COMMAND
    771 tty7     Rsl+   4:26 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
   1958 pts/0    Ss     0:00 bash
 588092 pts/0    R+     0:00 ps a

top

    771 root      20   0 1111612 160548 107020 R  30.5   1.1   5:18.33 /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch                               
 441471 jessbont  20   0  175164  17408  13952 S  11.9   0.1   0:45.88 i3bar --transparency --bar_id=bar-0 --socket=/run/user/1000/i3/ipc-socket.813                                       
 441480 jessbont  20   0    7516   3584   3200 S   5.3   0.0   0:20.71 bash /home/jessbont/.config/i3/scripts/i3-focusedwindow 79                                                          
    864 jessbont  20   0  769676 131808  98264 S   3.3   0.9   0:33.62 picom                                                                                                               
 441477 jessbont  20   0    2492   1664   1536 S   1.3   0.0   0:05.42 i3blocks -c /home/jessbont/.config/i3/i3blocks.conf                                                                 
  58343 jessbont  20   0 5672972 577720 253884 S   1.0   3.8   0:36.92 /usr/bin/python3 /usr/bin/qutebrowser                                                                               
    265 root      -2   0       0      0      0 S   0.7   0.0   0:05.60 [gfx_0.0.0]                                                                                                         
    438 root     -51   0       0      0      0 S   0.7   0.0   0:01.81 [irq/60-ELAN0678:00]                                                                                                
    823 jessbont  20   0    9084   4992   4224 S   0.7   0.0   0:02.31 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only           
  90511 jessbont  20   0 1134.9g 255168 103648 S   0.7   1.7   0:40.17 /usr/lib/qt6/QtWebEngineProcess --type=renderer --webengine-schemes=qute:lL;qrc:sV --disable-speech-api --enable-t+ 
 535135 root      20   0       0      0      0 D   0.7   0.0   0:00.24 [kworker/u32:3+events_unbound]                                                                                      
 693944 jessbont  20   0   12256   6016   3840 R   0.7   0.0   0:00.05 top 

tried to disable bar transparancy, killed picom and switching to zen kernel

Edit :
Hardware :

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  16
  On-line CPU(s) list:   0-15
Vendor ID:               AuthenticAMD
  Model name:            AMD Ryzen 7 PRO 6850U with Radeon Graphics
    CPU family:          25
    Model:               68
    Thread(s) per core:  2
    Core(s) per socket:  8
    Socket(s):           1
    Stepping:            1

I found that this script :

#!/usr/bin/env bash

while :
do
  ID=$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')
  if [[ $1 ]] 
  then
    TITLE=$(xprop -id $ID -len $1 | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
    echo "$TITLE"
  else
    TITLE=$(xprop -id $ID | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
    echo "$TITLE"
  fi
done

is consuming CPU at 10% after last kernel update, but if anyone know WHY ?

If you are using the integrated AMD GPU, a kernel update may have included an update to your graphics drivers. Graphics-related updates can affect the behavior of X-based tools like xprop. That’s just a guess of course, I have no way of knowing for certain.

If you want to tweak the script to bring resource usage down, you could try using something like xdotool to wait for window focus events and then query the window title (instead of running xprop in a loop). That might bring resource usage down a bit.

Or you could try adding a small sleep interval. This might help if the loop is executing too frequently. Something like this:

#!/usr/bin/env bash

while :
do
  ID=$(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')
  if [[ $1 ]] 
  then
    TITLE=$(xprop -id $ID -len $1 | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
    echo "$TITLE"
  else
    TITLE=$(xprop -id $ID | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2)
    echo "$TITLE"
  fi
  sleep 1  # Add a sleep interval of 1 second
done