Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU consumption with wayland 1.17.91 #6

Open
shamazmazum opened this issue Jan 28, 2020 · 1 comment
Open

High CPU consumption with wayland 1.17.91 #6

shamazmazum opened this issue Jan 28, 2020 · 1 comment

Comments

@shamazmazum
Copy link

shamazmazum commented Jan 28, 2020

Hello. After upgrading x11-wm/sway to a new version 1.4 I found it completely unusable (what a surprise!) Turns out it uses too much per-process timers and the kernel simply refuses to create more, rendering sway unusable. One solution to this problem is to bump TIMER_MAX in /usr/src/sys/sys/timers.h and recompile the kernel (hopefully, it doesn't break userland). The other solution is to upgrade to wayland 1.17.91 which tracks timers in userland and require only one timer from the kernel.
Obviously, it works in Linux, but in FreeBSD it causes to abnormally high number of calls to kevent() and almost 100% CPU usage. You can look at the issue I created for sway here for detailed information.

For example, here is the number of calls to kevent() by firefox and sway in the period of about 10 seconds.

firefox                       kevent()                                     507
  sway                        kevent()                                10377444

You can take my port for a fresh wayland from here.

Any ideas what's going on?

@shamazmazum
Copy link
Author

This is all syscalls by sway for a second or so:

  syscalls                                            mmap                                                              3
  syscalls                                            munmap                                                            3
  syscalls                                            recvmsg                                                           4
  syscalls                                            write                                                            10
  syscalls                                            sendmsg                                                          15
  syscalls                                            _umtx_op                                                         40
  syscalls                                            ioctl                                                            59
  syscalls                                            read                                                            141
  syscalls                                            ktimer_settime                                              1331620
  syscalls                                            kevent                                                      1331697
  syscalls                                            poll                                                        1331697

I hope, this can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant