Bug 483234 - High cpu load when idle on X11
Summary: High cpu load when idle on X11
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-11 13:03 UTC by Nicolas
Modified: 2024-04-17 03:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
cpu usage (98.33 KB, image/png)
2024-03-11 19:50 UTC, Nicolas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas 2024-03-11 13:03:15 UTC
SUMMARY
I experience a high CPU load in kwin_x11


STEPS TO REPRODUCE
1. idle computer, wait for screen locked and turned off


OBSERVED RESULT
cpu load high on single core

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-25-generic (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 31.0 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 20QVCTO1WW
System Version: ThinkPad X1 Extreme 2nd


ADDITIONAL INFORMATION
I've attached gdb and printed the stack trace, while in this state, maybe this is helpful(?)

(gdb) bt
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fff5300cb28)
    at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fff5300cb28)
    at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64
    (futex_word=futex_word@entry=0x7fff5300cb28, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x000079bb30a93a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5af80c2c2d48, cond=0x7fff5300cb00)
    at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x7fff5300cb00, mutex=0x5af80c2c2d48) at ./nptl/pthread_cond_wait.c:627
#5  0x000079bb346ebf2d in  () at /lib/x86_64-linux-gnu/libxcb.so.1
#6  0x000079bb346ece45 in xcb_wait_for_reply () at /lib/x86_64-linux-gnu/libxcb.so.1
#7  0x000079bb2bfaaf1e in QXcbBasicConnection::atomName(unsigned int) (this=0x5af80c2b9ec0, atom=522)
    at ./src/plugins/platforms/xcb/qxcbconnection_basic.cpp:157
#8  0x000079bb2bfd75b5 in QXcbScreen::getName(xcb_randr_monitor_info_t*)
    (this=this@entry=0x5af80c2d1eb0, monitorInfo=monitorInfo@entry=0x79bb1c01e070) at ./src/plugins/platforms/xcb/qxcbscreen.cpp:733
#9  0x000079bb2bfd7c5f in QXcbScreen::setMonitor(xcb_randr_monitor_info_t*, unsigned int)
    (this=0x5af80c2d1eb0, monitorInfo=<optimized out>, timestamp=<optimized out>) at ./src/plugins/platforms/xcb/qxcbscreen.cpp:681
#10 0x000079bb2bfaed65 in QXcbConnection::updateScreen_monitor(QXcbScreen*, xcb_randr_monitor_info_t*, unsigned int)
    (this=this@entry=0x5af80c2b9ec0, screen=screen@entry=0x5af80c2d1eb0, monitorInfo=monitorInfo@entry=0x79bb1c01e070, timestamp=<optimized out>) at ./src/plugins/platforms/xcb/qxcbconnection_screens.cpp:251
#11 0x000079bb2bfb1292 in QXcbConnection::initializeScreensFromMonitor(xcb_screen_iterator_t*, int, QXcbScreen**, bool)
    (this=this@entry=0x5af80c2b9ec0, it=it@entry=0x7fff5300d020, xcbScreenNumber=xcbScreenNumber@entry=0, primaryScreen=primaryScreen@entry=0x7fff5300d000, initialized=initialized@entry=true) at ./src/plugins/platforms/xcb/qxcbconnection_screens.cpp:519
#12 0x000079bb2bfb1b58 in QXcbConnection::initializeScreens(bool) (this=0x5af80c2b9ec0, initialized=true)
    at ./src/plugins/platforms/xcb/qxcbconnection_screens.cpp:317
#13 0x000079bb2bfa6ae2 in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) (this=0x5af80c2b9ec0, event=0x79bb1c0195e0)
    at ./src/plugins/platforms/xcb/qxcbconnection.cpp:590
#14 0x000079bb2bfad0ee in QXcbConnection::processXcbEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c2b9ec0, flags=...)
    at ./src/plugins/platforms/xcb/qxcbconnection.cpp:1087
#15 0x000079bb2bfc4a87 in xcbSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
    at ./src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:55
#16 0x000079bb30380d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x000079bb303d6258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x000079bb3037e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x000079bb3145e1f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c346010, flags=...)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#20 0x000079bb3166604b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5300d4d0, flags=..., 
    flags@entry=...) at ./src/corelib/global/qflags.h:34
#21 0x000079bb31667c7c in QCoreApplication::exec() () at ./src/corelib/global/qflags.h:74
#22 0x000079bb31ae9a20 in QGuiApplication::exec() () at ./src/gui/kernel/qguiapplication.cpp:1925
#23 0x000079bb327f1689 in QApplication::exec() () at ./src/widgets/kernel/qapplication.cpp:2574
#24 0x00005af80b498967 in main(int, char**) (argc=<optimized out>, argv=0x7fff5300d868) at ./src/main_x11.cpp:460
(gdb) info threads
  Id   Target Id                                            Frame 
* 1    Thread 0x79bb2cae6ac0 (LWP 3493) "kwin_x11"          __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, 
    expected=0, futex_word=0x7fff5300cb28) at ./nptl/futex-internal.c:57
  2    Thread 0x79bb2bf5b640 (LWP 3516) "QDBusConnection"   0x000079bb30b18bcf in __GI___poll (fds=0x79bb24025a90, nfds=4, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  3    Thread 0x79bb2b75a640 (LWP 3517) "QXcbEventQueue"    0x000079bb30b18bcf in __GI___poll (fds=0x79bb2b759928, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  4    Thread 0x79bb2103c640 (LWP 3579) "QQmlThread"        0x000079bb30b18bcf in __GI___poll (fds=0x79bb1c00a410, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  5    Thread 0x79bb00e43640 (LWP 3606) "CPMMListener"      0x000079bb30b18bcf in __GI___poll (fds=0x79bb00e42a78, nfds=1, 
    timeout=300000) at ../sysdeps/unix/sysv/linux/poll.c:29
  6    Thread 0x79bb17014640 (LWP 32676) "FreezeDetector"   0x000079bb30b18bcf in __GI___poll (fds=0x5af80c966ac0, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  7    Thread 0x79baf7887640 (LWP 395821) "vsync event mon" 0x000079bb30b18bcf in __GI___poll (fds=0x5af80ce8a550, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
(gdb) c
Continuing.
^C
Thread 1 "kwin_x11" received signal SIGINT, Interrupt.
0x000079bb30aa26b1 in _int_free (av=0x79bb30c1ac80 <main_arena>, p=0x5af80d032e80, have_lock=0) at ./malloc/malloc.c:4431
4431    ./malloc/malloc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x000079bb30aa26b1 in _int_free (av=0x79bb30c1ac80 <main_arena>, p=0x5af80d032e80, have_lock=0) at ./malloc/malloc.c:4431
#1  0x000079bb30aa5453 in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3391
#2  0x000079bb342e39e5 in KWin::Edid::Edid(void const*, unsigned int) () at /lib/x86_64-linux-gnu/libkwin.so.6
#3  0x00005af80b4a50d4 in KWin::X11StandaloneBackend::doUpdateOutputs<KWin::Xcb::RandR::CurrentResources>()
    (this=this@entry=0x5af80c53c5b0) at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:376
#4  0x00005af80b4a584d in KWin::X11StandaloneBackend::updateOutputs() (this=0x5af80c53c5b0)
    at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:283
#5  0x000079bb3162b7ce in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fff5300d100, r=0x5af80c53c5b0, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#6  doActivate<false>(QObject*, int, void**) (sender=0x5af80c53c3c0, signal_index=3, argv=0x7fff5300d100)
    at ./src/corelib/kernel/qobject.cpp:4039
#7  0x000079bb315de14e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...)
    at ./obj-x86_64-linux-gnu/src/corelib/Core_autogen/include/moc_qtimer.cpp:272
#8  0x000079bb315c94ce in QObject::event(QEvent*) (this=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/corelib/kernel/qobject.cpp:1414
#9  0x000079bb327f40eb in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=<optimized out>, receiver=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/widgets/kernel/qapplication.cpp:3296
#10 0x000079bb31663e18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5af80c53c3c0, event=0x7fff5300d270)
    at ./src/corelib/kernel/qcoreapplication.cpp:1121
#11 0x000079bb3155f121 in QTimerInfoList::activateTimers() (this=0x5af80c326540) at ./src/corelib/kernel/qtimerinfo_unix.cpp:507
#12 0x000079bb31463144 in timerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:149
#13 idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:196
#14 0x000079bb30380d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x000079bb303d6258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x000079bb3037e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x000079bb3145e1f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c346010, flags=...)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#18 0x000079bb3166604b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5300d4d0, flags=..., 
    flags@entry=...) at ./src/corelib/global/qflags.h:34
#19 0x000079bb31667c7c in QCoreApplication::exec() () at ./src/corelib/global/qflags.h:74
#20 0x000079bb31ae9a20 in QGuiApplication::exec() () at ./src/gui/kernel/qguiapplication.cpp:1925
#21 0x000079bb327f1689 in QApplication::exec() () at ./src/widgets/kernel/qapplication.cpp:2574
#22 0x00005af80b498967 in main(int, char**) (argc=<optimized out>, argv=0x7fff5300d868) at ./src/main_x11.cpp:460
(gdb) info threads
  Id   Target Id                                            Frame 
* 1    Thread 0x79bb2cae6ac0 (LWP 3493) "kwin_x11"          0x000079bb30aa26b1 in _int_free (av=0x79bb30c1ac80 <main_arena>, 
    p=0x5af80d032e80, have_lock=0) at ./malloc/malloc.c:4431
  2    Thread 0x79bb2bf5b640 (LWP 3516) "QDBusConnection"   0x000079bb30b18bcf in __GI___poll (fds=0x79bb24025a90, nfds=4, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  3    Thread 0x79bb2b75a640 (LWP 3517) "QXcbEventQueue"    0x000079bb30b18bcf in __GI___poll (fds=0x79bb2b759928, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  4    Thread 0x79bb2103c640 (LWP 3579) "QQmlThread"        0x000079bb30b18bcf in __GI___poll (fds=0x79bb1c00a410, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  5    Thread 0x79bb00e43640 (LWP 3606) "CPMMListener"      0x000079bb30b18bcf in __GI___poll (fds=0x79bb00e42a78, nfds=1, 
    timeout=300000) at ../sysdeps/unix/sysv/linux/poll.c:29
  6    Thread 0x79bb17014640 (LWP 32676) "FreezeDetector"   0x000079bb30b18bcf in __GI___poll (fds=0x5af80c966ac0, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
  7    Thread 0x79baf7887640 (LWP 395821) "vsync event mon" 0x000079bb30b18bcf in __GI___poll (fds=0x5af80ce8a550, nfds=1, timeout=-1)
    at ../sysdeps/unix/sysv/linux/poll.c:29
(gdb) c
Continuing.
^C
Thread 1 "kwin_x11" received signal SIGINT, Interrupt.
__futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fff5300c0f8) at ./nptl/futex-internal.c:57
57      ./nptl/futex-internal.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fff5300c0f8)
    at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x7fff5300c0f8)
    at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64
    (futex_word=futex_word@entry=0x7fff5300c0f8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x000079bb30a93a41 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5af80c2c2d48, cond=0x7fff5300c0d0)
    at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=0x7fff5300c0d0, mutex=0x5af80c2c2d48) at ./nptl/pthread_cond_wait.c:627
#5  0x000079bb346ebf2d in  () at /lib/x86_64-linux-gnu/libxcb.so.1
#6  0x000079bb346ece45 in xcb_wait_for_reply () at /lib/x86_64-linux-gnu/libxcb.so.1
#7  0x00005af80b4ab127 in KWin::Xcb::AbstractWrapper<KWin::Xcb::PointerData>::getReply() (this=0x7fff5300c190)
    at backends/x11/standalone/./src/utils/xcbutils.h:344
#8  KWin::Xcb::AbstractWrapper<KWin::Xcb::PointerData>::getReply() (this=0x7fff5300c190)
    at backends/x11/standalone/./src/utils/xcbutils.h:344
#9  KWin::Xcb::AbstractWrapper<KWin::Xcb::PointerData>::isNull() (this=0x7fff5300c190)
    at backends/x11/standalone/./src/utils/xcbutils.h:271
#10 KWin::X11Cursor::doGetPos() (this=0x5af80c56e730)
    at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_cursor.cpp:69
#11 0x000079bb3401d982 in KWin::Cursor::pos() () at /lib/x86_64-linux-gnu/libkwin.so.6
#12 0x000079bb3422649e in KWin::Workspace::desktopResized() () at /lib/x86_64-linux-gnu/libkwin.so.6
#13 0x000079bb34215f17 in KWin::Workspace::updateOutputs(QList<KWin::Output*> const&) () at /lib/x86_64-linux-gnu/libkwin.so.6
#14 0x000079bb3420dc11 in KWin::Workspace::slotOutputBackendOutputsQueried() () at /lib/x86_64-linux-gnu/libkwin.so.6
#15 0x000079bb3162b7ce in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fff5300c868, r=0x5af80c53f580, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#16 doActivate<false>(QObject*, int, void**) (sender=0x5af80c53c5b0, signal_index=3, argv=0x7fff5300c868)
    at ./src/corelib/kernel/qobject.cpp:4039
#17 0x00005af80b4a452d in KWin::X11StandaloneBackend::doUpdateOutputs<KWin::Xcb::RandR::CurrentResources>()
    (this=this@entry=0x5af80c53c5b0) at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:445
#18 0x00005af80b4a584d in KWin::X11StandaloneBackend::updateOutputs() (this=0x5af80c53c5b0)
    at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:283
#19 0x000079bb3162b7ce in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fff5300d100, r=0x5af80c53c5b0, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#20 doActivate<false>(QObject*, int, void**) (sender=0x5af80c53c3c0, signal_index=3, argv=0x7fff5300d100)
    at ./src/corelib/kernel/qobject.cpp:4039
#21 0x000079bb315de14e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...)
    at ./obj-x86_64-linux-gnu/src/corelib/Core_autogen/include/moc_qtimer.cpp:272
#22 0x000079bb315c94ce in QObject::event(QEvent*) (this=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/corelib/kernel/qobject.cpp:1414
#23 0x000079bb327f40eb in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=<optimized out>, receiver=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/widgets/kernel/qapplication.cpp:3296
#24 0x000079bb31663e18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5af80c53c3c0, event=0x7fff5300d270)
    at ./src/corelib/kernel/qcoreapplication.cpp:1121
#25 0x000079bb3155f121 in QTimerInfoList::activateTimers() (this=0x5af80c326540) at ./src/corelib/kernel/qtimerinfo_unix.cpp:507
#26 0x000079bb31463144 in timerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:149
#27 idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:196
#28 0x000079bb30380d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x000079bb303d6258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#30 0x000079bb3037e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x000079bb3145e1f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c346010, flags=...)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#32 0x000079bb3166604b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5300d4d0, flags=..., 
    flags@entry=...) at ./src/corelib/global/qflags.h:34
#33 0x000079bb31667c7c in QCoreApplication::exec() () at ./src/corelib/global/qflags.h:74
#34 0x000079bb31ae9a20 in QGuiApplication::exec() () at ./src/gui/kernel/qguiapplication.cpp:1925
#35 0x000079bb327f1689 in QApplication::exec() () at ./src/widgets/kernel/qapplication.cpp:2574
#36 0x00005af80b498967 in main(int, char**) (argc=<optimized out>, argv=0x7fff5300d868) at ./src/main_x11.cpp:460
(gdb) c
Continuing.
^C
Thread 1 "kwin_x11" received signal SIGINT, Interrupt.
QIODevice::readLine (this=<optimized out>, maxSize=<optimized out>) at ./src/corelib/io/qiodevice.cpp:1478
1478    ./src/corelib/io/qiodevice.cpp: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  QIODevice::readLine(long long) (this=<optimized out>, maxSize=<optimized out>) at ./src/corelib/io/qiodevice.cpp:1478
#1  0x000079bb342e395d in KWin::Edid::Edid(void const*, unsigned int) () at /lib/x86_64-linux-gnu/libkwin.so.6
#2  0x00005af80b4a50d4 in KWin::X11StandaloneBackend::doUpdateOutputs<KWin::Xcb::RandR::CurrentResources>()
    (this=this@entry=0x5af80c53c5b0) at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:376
#3  0x00005af80b4a584d in KWin::X11StandaloneBackend::updateOutputs() (this=0x5af80c53c5b0)
    at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:283
#4  0x000079bb3162b7ce in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fff5300d100, r=0x5af80c53c5b0, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#5  doActivate<false>(QObject*, int, void**) (sender=0x5af80c53c3c0, signal_index=3, argv=0x7fff5300d100)
    at ./src/corelib/kernel/qobject.cpp:4039
#6  0x000079bb315de14e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...)
    at ./obj-x86_64-linux-gnu/src/corelib/Core_autogen/include/moc_qtimer.cpp:272
#7  0x000079bb315c94ce in QObject::event(QEvent*) (this=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/corelib/kernel/qobject.cpp:1414
#8  0x000079bb327f40eb in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=<optimized out>, receiver=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/widgets/kernel/qapplication.cpp:3296
#9  0x000079bb31663e18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5af80c53c3c0, event=0x7fff5300d270)
    at ./src/corelib/kernel/qcoreapplication.cpp:1121
#10 0x000079bb3155f121 in QTimerInfoList::activateTimers() (this=0x5af80c326540) at ./src/corelib/kernel/qtimerinfo_unix.cpp:507
#11 0x000079bb31463144 in timerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:149
#12 idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:196
#13 0x000079bb30380d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x000079bb303d6258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x000079bb3037e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x000079bb3145e1f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c346010, flags=...)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#17 0x000079bb3166604b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5300d4d0, flags=..., 
    flags@entry=...) at ./src/corelib/global/qflags.h:34
#18 0x000079bb31667c7c in QCoreApplication::exec() () at ./src/corelib/global/qflags.h:74
#19 0x000079bb31ae9a20 in QGuiApplication::exec() () at ./src/gui/kernel/qguiapplication.cpp:1925
#20 0x000079bb327f1689 in QApplication::exec() () at ./src/widgets/kernel/qapplication.cpp:2574
#21 0x00005af80b498967 in main(int, char**) (argc=<optimized out>, argv=0x7fff5300d868) at ./src/main_x11.cpp:460
(gdb) c
Continuing.
^C
Thread 1 "kwin_x11" received signal SIGINT, Interrupt.
0x000079bb30aa5992 in __GI___libc_realloc (oldmem=<optimized out>, bytes=<optimized out>) at ./malloc/malloc.c:3515
3515    ./malloc/malloc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  0x000079bb30aa5992 in __GI___libc_realloc (oldmem=<optimized out>, bytes=<optimized out>) at ./malloc/malloc.c:3515
#1  0x000079bb315b384c in QArrayData::reallocateUnaligned(QArrayData*, void*, long long, long long, QArrayData::AllocationOption)
    (data=0x5af80d079de0, dataPointer=<optimized out>, objectSize=<optimized out>, capacity=13, option=<optimized out>)
    at ./src/corelib/tools/qarraydata.cpp:220
#2  0x000079bb3161f10a in QTypedArrayData<char>::reallocateUnaligned(QTypedArrayData<char>*, char*, long long, QArrayData::AllocationOption) (option=<optimized out>, capacity=<optimized out>, dataPointer=<optimized out>, data=<optimized out>)
    at ./src/corelib/tools/qarraydata.h:118
#3  QtPrivate::QPodArrayOps<char>::reallocate(long long, QArrayData::AllocationOption)
    (option=<optimized out>, alloc=<optimized out>, this=0x7fff5300c770) at ./src/corelib/tools/qarraydataops.h:295
#4  QByteArray::reallocData(long long, QArrayData::AllocationOption) (this=0x7fff5300c770, alloc=<optimized out>, option=<optimized out>)
    at ./src/corelib/text/qbytearray.cpp:1934
#5  0x000079bb316cf760 in QByteArray::squeeze() (this=0x7fff5300c770) at ./src/corelib/text/qbytearray.h:570
#6  QIODevice::readLine(long long) (this=<optimized out>, maxSize=<optimized out>) at ./src/corelib/io/qiodevice.cpp:1478
#7  0x000079bb342e395d in KWin::Edid::Edid(void const*, unsigned int) () at /lib/x86_64-linux-gnu/libkwin.so.6
#8  0x00005af80b4a50d4 in KWin::X11StandaloneBackend::doUpdateOutputs<KWin::Xcb::RandR::CurrentResources>()
    (this=this@entry=0x5af80c53c5b0) at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:376
#9  0x00005af80b4a584d in KWin::X11StandaloneBackend::updateOutputs() (this=0x5af80c53c5b0)
    at backends/x11/standalone/./src/backends/x11/standalone/x11_standalone_backend.cpp:283
#10 0x000079bb3162b7ce in QtPrivate::QSlotObjectBase::call(QObject*, void**)
    (a=0x7fff5300d100, r=0x5af80c53c5b0, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at ./src/corelib/kernel/qobjectdefs_impl.h:433
#11 doActivate<false>(QObject*, int, void**) (sender=0x5af80c53c3c0, signal_index=3, argv=0x7fff5300d100)
    at ./src/corelib/kernel/qobject.cpp:4039
#12 0x000079bb315de14e in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...)
    at ./obj-x86_64-linux-gnu/src/corelib/Core_autogen/include/moc_qtimer.cpp:272
#13 0x000079bb315c94ce in QObject::event(QEvent*) (this=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/corelib/kernel/qobject.cpp:1414
#14 0x000079bb327f40eb in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    (this=<optimized out>, receiver=0x5af80c53c3c0, e=0x7fff5300d270) at ./src/widgets/kernel/qapplication.cpp:3296
#15 0x000079bb31663e18 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x5af80c53c3c0, event=0x7fff5300d270)
    at ./src/corelib/kernel/qcoreapplication.cpp:1121
#16 0x000079bb3155f121 in QTimerInfoList::activateTimers() (this=0x5af80c326540) at ./src/corelib/kernel/qtimerinfo_unix.cpp:507
#17 0x000079bb31463144 in timerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:149
#18 idleTimerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:196
#19 0x000079bb30380d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x000079bb303d6258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x000079bb3037e3e3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x000079bb3145e1f0 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x5af80c346010, flags=...)
    at ./src/corelib/kernel/qeventdispatcher_glib.cpp:393
#23 0x000079bb3166604b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fff5300d4d0, flags=..., 
    flags@entry=...) at ./src/corelib/global/qflags.h:34
#24 0x000079bb31667c7c in QCoreApplication::exec() () at ./src/corelib/global/qflags.h:74
#25 0x000079bb31ae9a20 in QGuiApplication::exec() () at ./src/gui/kernel/qguiapplication.cpp:1925
#26 0x000079bb327f1689 in QApplication::exec() () at ./src/widgets/kernel/qapplication.cpp:2574
#27 0x00005af80b498967 in main(int, char**) (argc=<optimized out>, argv=0x7fff5300d868) at ./src/main_x11.cpp:460
Comment 1 Nate Graham 2024-03-11 19:03:32 UTC
Is it kwin_x11 that's taking up excessive CPU? Or other things?
Comment 2 Nicolas 2024-03-11 19:49:46 UTC
For me, it looks like kwin_x11, though it could of course just the symptom not the cause, see the screenshot of htop
Comment 3 Nicolas 2024-03-11 19:50:11 UTC
Created attachment 166981 [details]
cpu usage
Comment 4 Victor Toofic 2024-03-17 20:39:00 UTC
I'm also experiencing this issue with kwin_x11 since 6.0.0, still present in 6.0.2.

This is probably related to screenlocker and nvidia gpu. As soon as the session is locked (either with a shortcut Meta+L or due to inactivity), kwin_x11 cpu usage jumps up to 60%-80% of one core. I have another laptop with exactly the same software versions but an AMD gpu and the issue does not reproduce there.

I've tried different screenlocker configurations: clock visible on and off, wallpaper image, plain color, slideshow, etc., and the problem persists with any configuration, with just the laptop display and with one or two external displays, even when the displays are turned off due to the energy savings profile. I also tried disabling compositing (shit+alt+F12) before locking the session but didn't have any effect.

I usually leave the laptop running overnight, and when I get back in the morning the fans are spinning fast, after unlocking the session cpu usage goes back to normal and fans get quiet again. I had to disable locking the screen for this reason, and just leave dpms to turn off the monitors after some time but with the session unlocked.

One thing I noticed is that is not possible to remove the focus from the password textbox, could it be that the cursor blinking is causing some kind of re-rendering even when the screen is blank and the displays are turned off?

----------
Operating System: Manjaro Linux 
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.6.21-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 16 × Intel® Core™ i9-10885H CPU @ 2.40GHz
Memory: 62.4 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1650 Ti with Max-Q Design/PCIe/SSE2
Manufacturer: LENOVO
System Version: ThinkPad X1 Extreme Gen 3
-----

Please let me know if there is anything I can do to help debug this issue.

Thank you for help!
Comment 5 Vlad Zahorodnii 2024-03-18 10:04:12 UTC
Hmm it looks like kwin keeps constantly receiving RANDR events, i.e. events about output changes, which triggers kwin to reparse EDID and rearrange windows
Comment 6 Bug Janitor Service 2024-04-02 03:47:09 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2024-04-17 03:47:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!