<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>448557</bug_id>
          
          <creation_ts>2022-01-15 22:00:48 +0000</creation_ts>
          <short_desc>kwin_wayland constantly consuming 20-60% of a CPU core recently when using AMS cursor</short_desc>
          <delta_ts>2022-01-22 20:42:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>wayland-generic</component>
          <version>git master</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>efficiency-and-performance</keywords>
          <priority>HI</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nate Graham">nate</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>auxsvr</cc>
    
    <cc>herzenschein</cc>
    
    <cc>keith</cc>
    
    <cc>postix</cc>
    
    <cc>xaver.hugl</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/commit/547bb52c6c3833d76bbffef46fa9b3f3ae51dccf</cf_commitlink>
          <cf_versionfixedin>5.24</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2094163</commentid>
    <comment_count>0</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-15 22:00:48 +0000</bug_when>
    <thetext>I build all KDE stuff from git master every day, and for at least the last two days, kwin_wayland has been consuming between 20 and 60% of a CPU core at idle. It causes input lag and makes the system nearly unusable.

I attempted to bisect but was unable to due to tight coupling between KWin and its dependencies.

The journal log doesn&apos;t have anything fishy-looking in it.

I&apos;m not sure how to debug this but can provide any logs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2094169</commentid>
    <comment_count>1</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-15 22:11:27 +0000</bug_when>
    <thetext>kwin_x11 is unaffected. I&apos;ve temporarily gone back to X11 to have a usable system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2094404</commentid>
    <comment_count>2</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-16 15:39:02 +0000</bug_when>
    <thetext>This seems to have been fixed with a mesa update today.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2094828</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-17 19:40:20 +0000</bug_when>
    <thetext>Never mind, it turned out that that didn&apos;t fix it.

However, after some investigation in #kwin, setting `KWIN_DRM_NO_AMS=1` *did* fix it. So it looks like this isue is related to eprformance issues with the AMS cursor. Re-opening.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2094830</commentid>
    <comment_count>4</comment_count>
    <who name="Keith Calvelli">keith</who>
    <bug_when>2022-01-17 19:55:01 +0000</bug_when>
    <thetext>(In reply to Nate Graham from comment #3)
&gt; Never mind, it turned out that that didn&apos;t fix it.
&gt; 
&gt; However, after some investigation in #kwin, setting `KWIN_DRM_NO_AMS=1`
&gt; *did* fix it. So it looks like this isue is related to eprformance issues
&gt; with the AMS cursor. Re-opening.

I am also impacted by this.  Nate&apos;s workaround seems to work for me.

Note that previous to the workaround, in addition to the CPU consumption from kwin_wayland, I was unable to create new desktops and switch between existing desktops using the overview effect.  The workaround seems to have fixed that issue as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2094958</commentid>
    <comment_count>5</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-01-18 10:23:10 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1904</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095212</commentid>
    <comment_count>6</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-01-18 21:52:29 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1907</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095316</commentid>
    <comment_count>7</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2022-01-19 10:52:00 +0000</bug_when>
    <thetext>Git commit 50c167c94b33702f3f026e007bda424ec1af047d by Xaver Hugl.
Committed on 19/01/2022 at 10:31.
Pushed by zamundaaa into branch &apos;master&apos;.

backends/drm: fix reallocation check

When no modifiers are used at all, we shouldn&apos;t check them.

M  +2    -1    src/backends/drm/egl_gbm_backend.cpp

https://invent.kde.org/plasma/kwin/commit/50c167c94b33702f3f026e007bda424ec1af047d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095458</commentid>
    <comment_count>8</comment_count>
    <who name="Vlad Zahorodnii">vlad.zahorodnii</who>
    <bug_when>2022-01-19 17:25:11 +0000</bug_when>
    <thetext>Git commit 547bb52c6c3833d76bbffef46fa9b3f3ae51dccf by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 19/01/2022 at 17:25.
Pushed by vladz into branch &apos;Plasma/5.24&apos;.

backends/drm: fix reallocation check

When no modifiers are used at all, we shouldn&apos;t check them.


(cherry picked from commit 50c167c94b33702f3f026e007bda424ec1af047d)

M  +2    -1    src/backends/drm/egl_gbm_backend.cpp

https://invent.kde.org/plasma/kwin/commit/547bb52c6c3833d76bbffef46fa9b3f3ae51dccf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095480</commentid>
    <comment_count>9</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-01-19 18:26:50 +0000</bug_when>
    <thetext>That completely fixes the problem for me, hooray! kwin_wayland is once again down to 0% CPU most of the time, with occasional spikes to 10%.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2096919</commentid>
    <comment_count>10</comment_count>
    <who name="postix">postix</who>
    <bug_when>2022-01-22 20:42:48 +0000</bug_when>
    <thetext>Do you know if these changes are already in KDE Neon Testing?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>