** Tags added: vsync

** Description changed:

  Originally filed under compiz:
  https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/1744515. Testing
  indicates it affects Wayland as well.
  
  The automatically-included information for this reports notes that I'm
  using kernel 4.8, where this issue doesn't occur.
  
  When the screen updates in recent versions of the Linux kernel,
  including 4.13 and 4.15 while running Compiz or Wayland, it causes high
  CPU usage in a kworker thread. This was 30~40% of a CPU core on my
  system with 4.13 kernel, and is 65% with 4.15. This doesn't happen with
  Metacity or non-Wayland Gnome. Since Unity uses Compiz, it happens there
  as well.
  
  This seems unrelated to how much of the screen is being repainted, as
  the 'Show Repaint' plugin in Compiz can show that only a few pixels are
  being updated and the kworker load is the same.
  
  Updated test results, having upgraded to Bionic Beaver 18.04, with
  kernel 4.15.0-15-generic,
  
  -my Flashback compiz login no longer works, it just crashes back to the login 
screen, so I can't test it.
  -Unity uses compiz and still works for me, and still has this bug.
  -Wayland has this bug and doesn't use compiz.
  
  Other display managers remain the same. Metacity is the best in terms of
  not causing the kernel to waste CPU; 'Ubuntu with Gnome' is the second-
  best, only causing an extra 10~20% of CPU usage from gnome-shell, and no
  high-CPU kworker threads.
  
  When screen is updating under Wayland, one or two kworker threads use a
  combined 65% of a CPU core, with gnome-shell using an additional 8% CPU.
  
  This can be trivially triggered by running glxgears, the command 'ffmpeg
  -filter_complex color=orange:2x2 -f opengl -', or the command 'ffplay
  dummy -f lavfi  -graph color=orange:2x2:60' which all should update a
  small part of the screen at a tiny CPU cost. For me glxgears uses 1.5%,
  while ffplay or ffmpeg use 7~12% to create a 2x2 pixel video, but all
  three programs cause an extra 65% CPU use from the kernel.
  
  My laptop's battery is completely dead so I have to keep it plugged in
  all the time, but this should be a concern to anyone with a laptop as it
  will affect battery life.
  
  The 18.04 kernel is not one for which bugs can be filed at kernel.org:
  https://www.kernel.org/doc/html/v4.10/admin-guide/reporting-bugs.html
  
  I already confirmed the bug upstream, I assume from Debian; can someone
  who can replicate this bug test the latest -rc kernel from kernel.org?
  
+ NEW DATA POINT! I followed the instructions here to stop screen tearing
+ in Metacity: http://dan.bodar.com/2018/02/26/stop-screen-tearing-on-
+ ubuntu-by-changing-compositor/
+ 
+ However, after testing for this bug with compton running, I found that
+ the bug does occur. Seeing 55% CPU from kworker. If I kill compton while
+ glxgears is running, the kworker thread immediately disappears from
+ 'top'.
+ 
+ I'm guessing the kernel is trying too hard to match screen vsync
+ (vertical sync).
+ 
  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: linux-generic 4.13.0.25.26
  ProcVersionSignature: Ubuntu 4.8.0-34.36-generic 4.8.11
  Uname: Linux 4.8.0-34-generic x86_64
  ApportVersion: 2.20.7-0ubuntu3.7
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/pcmC0D0p:   misaki     1685 F...m pulseaudio
   /dev/snd/controlC0:  misaki     1685 F.... pulseaudio
  CurrentDesktop: GNOME-Flashback:GNOME
  Date: Sun Jan 21 00:17:16 2018
  HibernationDevice: RESUME=UUID=ea8d7b22-9a3e-412e-af6a-8fc260a76a2c
  MachineType: ASUSTeK Computer Inc. N50Vn
  ProcFB: 0 nouveaufb
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.8.0-34-generic 
root=UUID=b09dc720-93ec-4fdf-a42f-7ea19a9af555 ro quiet splash vt.handoff=7
  RelatedPackageVersions:
   linux-restricted-modules-4.8.0-34-generic N/A
   linux-backports-modules-4.8.0-34-generic  N/A
   linux-firmware                            1.169.1
  SourcePackage: linux
  UpgradeStatus: Upgraded to artful on 2018-01-09 (12 days ago)
  WpaSupplicantLog:
  
  dmi.bios.date: 03/05/2009
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: 211
  dmi.board.asset.tag: ATN12345678901234567
  dmi.board.name: N50Vn
  dmi.board.vendor: ASUSTeK Computer Inc.
  dmi.board.version: 1.0
  dmi.chassis.asset.tag: ATN12345678901234567
  dmi.chassis.type: 10
  dmi.chassis.vendor: ASUSTeK Computer Inc.
  dmi.chassis.version: 1.0
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvr211:bd03/05/2009:svnASUSTeKComputerInc.:pnN50Vn:pvr1.0:rvnASUSTeKComputerInc.:rnN50Vn:rvr1.0:cvnASUSTeKComputerInc.:ct10:cvr1.0:
  dmi.product.name: N50Vn
  dmi.product.version: 1.0
  dmi.sys.vendor: ASUSTeK Computer Inc.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1744543

Title:
  Screen updating with Compiz or Wayland causes high-CPU kworker thread
  in recent kernels

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1744543/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to