Bug 393706

Summary: New windows cause kwin to eat CPU for 3-4 seconds (fbdev + llvmpipe)
Product: [Plasma] kwin Reporter: Luke-Jr <luke-jr+kdebugs>
Component: decorationsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Luke-Jr 2018-04-30 23:28:46 UTC
Due to platform issues, the radeon driver crashes my system daily. As a workaround, so I can get work done, I am stuck using the fbdev Xorg driver.

Everything works great, even 3D games like Jedi Academy are playable (using llvmpipe 3D rendering on ~13 cores), yet for some reason whenever I open a window, KWin eats 100% of a single CPU core for a full 3-4 seconds before drawing the decoration (or allowing any further usage of the GUI). With multiple windows, I have to wait 3-4 seconds *per window* before the system responds again - using Xpra to attach to dozens of windows, I have to just go do something else while I wait.

Compositing is of course disabled.

perf report shows:

Samples: 473K of event 'cycles:ppp', Event count (approx.): 440153905977                                                                                   
Overhead  Command          Shared Object                     Symbol                                                                                        
   2.99%  kwin_x11         libLLVMAnalysis.so.5.0.1          [.] llvm::PointerMayBeCaptured                                                                
   2.06%  kwin_x11         libLLVMCodeGen.so.5.0.1           [.] _init                                                                                     
   1.86%  kwin_x11         libLLVMSelectionDAG.so.5.0.1      [.] _init                                                                                     
   1.83%  kwin_x11         libc-2.25.so                      [.] _int_malloc                                                                               
   1.65%  kwin_x11         libc-2.25.so                      [.] _int_free                                                                                 
   1.61%  kwin_x11         libLLVMCore.so.5.0.1              [.] _init                                                                                     
   1.55%  kwin_x11         libc-2.25.so                      [.] malloc                                                                                    
   1.35%  kwin_x11         libLLVMAnalysis.so.5.0.1          [.] _init                                                                                     
   1.31%  kwin_x11         libLLVMSupport.so.5.0.1           [.] llvm::FoldingSetNodeID::AddInteger                                                        
   1.31%  kwin_x11         libc-2.25.so                      [.] __memcpy_power7                                                                           
   1.02%  kwin_x11         libLLVMSupport.so.5.0.1           [.] llvm::SmallPtrSetImplBase::FindBucketFor                                                  
   0.95%  kwin_x11         libLLVMSupport.so.5.0.1           [.] _init                                                                                     
   0.93%  kwin_x11         swrastg_dri.so                    [.] convert_ubyte_rgba_to_bgra                                                                
   0.72%  kwin_x11         libLLVMCodeGen.so.5.0.1           [.] llvm::LiveIntervalUnion::Query::collectInterferingVRegs                                   
   0.60%  kwin_x11         libLLVMCore.so.5.0.1              [.] llvm::Use::getUser                                                                        
   0.58%  kwin_x11         libLLVMCore.so.5.0.1              [.] llvm::Use::getImpliedUser                                                                 
   0.58%  kwin_x11         libLLVMSelectionDAG.so.5.0.1      [.] llvm::SelectionDAG::computeKnownBits                                                      
   0.57%  kwin_x11         libLLVMSupport.so.5.0.1           [.] llvm::SmallPtrSetImplBase::insert_imp_big                                                 
   0.55%  kwin_x11         libLLVMCore.so.5.0.1              [.] llvm::Type::getPrimitiveSizeInBits                                                        
   0.54%  kwin_x11         libLLVMAnalysis.so.5.0.1          [.] llvm::BasicAAResult::DecomposeGEPExpression
Comment 1 Martin Flöser 2018-05-01 06:40:17 UTC
Please provide the output of qdbus org.kde.KWin /KWin supportInformation
Comment 2 Luke-Jr 2018-05-01 07:49:25 UTC
Version
=======
KWin version: 5.11.5
Qt Version: 5.9.4
Qt compile version: 5.9.4
XCB compile version: 1.12

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_INPUT: yes
HAVE_DRM: yes
HAVE_GBM: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 11905000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.kwin.aurorae
Theme: kwin4_decoration_qml_plastik
Blur: 1
onAllDesktopsAvailable: true
alphaChannelSupported: false
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 5, 4, 7, 3, 2, 9, 6
decorationButtonsRight: 0
borderSize: 3
gridUnit: 10
font: Droid Sans,10,-1,0,50,0,0,0,0,0,Regular
smallSpacing: 2
largeSpacing: 10

Options
=======
focusPolicy: 0
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: false
autoRaiseInterval: 0
delayFocusInterval: 0
shadeHover: true
shadeHoverInterval: 250
separateScreenFocus: false
placement: 4
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 0
legacyFullscreenSupport: false
operationTitlebarDblClick: 5009
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 30
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 30
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 6
commandWindowWheel: 31
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: true
condensedTitle: false
electricBorderMaximize: false
electricBorderTiling: false
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
inactiveTabsSkipTaskbar: false
autogroupSimilarWindows: false
autogroupInForeground: true
compositingMode: 1
useCompositing: true
compositingInitialized: true
hiddenPreviews: 1
glSmoothScale: 2
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: true
glPreferBufferSwap: 101
glPlatformInterface: 1
windowsBlockCompositing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 1

Screen 0:
---------
Name: default
Geometry: 0,0,1920x1080
Refresh Rate: 0


Compositing
===========
Compositing is not active
Comment 3 Martin Flöser 2018-05-01 11:48:53 UTC
Please try switching to the breeze window decoration. It might significantly improve the experience
Comment 4 Luke-Jr 2018-05-01 19:11:33 UTC
Breeze does indeed eliminate the delay. However, I much prefer Plastik. Is that part of KWin, or where should the bug get reassigned?
Comment 5 Martin Flöser 2018-05-02 04:28:37 UTC
Please update to 5.12. It has improved support for this situation.