question

BenWerthmann-2645 avatar image
1 Vote"
BenWerthmann-2645 asked ·

Team on Linux consumes 1 cpu core checking current cpu scaling_governor and power supply status 1.5 million times per second

Hello,

Teams is opening and reading these two files as fast as it can consuming one core of my linux laptop.

 23481 teams 70 0 /sys/class/power_supply/AC/online
 23481 teams 70 0 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor


In 60 seconds I've observed 1,568,360 opens.

Related FlameGraph:

6956-2020-04-06-12-07-09-teams-flamegraph-acpi.png




Are debug symbols available for teams? If so, we can probably isolate the origin codepath...

office-teams-linux-itpro
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@BenWerthmann-2645 thank you for reporting this. Does this happen all the time, or only in some scenarios? For example after you end a video call? Thank you

0 Votes 0 ·
JimmyYang-MSFT avatar image
0 Votes"
JimmyYang-MSFT answered ·

Hi BenWerthmann-2645!
I tried to find if there are any documents referring to debug symbol in Microsoft Teams for Linux but didn’t find anything useful official documents support about it. Maybe you can try to see if it can be applied well in Teams for Linux. For more details about how to debug packages with debug symbol, you can refer to: https://www.hiroom2.com/2018/04/27/ubuntu-1804-dbgsym-en/

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for the reply. Debug symbols would help with identification of the defect. The primary intent of this is to be a bug report.

0 Votes 0 ·
RodeKater-6917 avatar image
0 Votes"
RodeKater-6917 answered ·

Hi @MarianJavorkaMSFT @JimmyYang-MSFT , it doesn't happen all the time, though it seems to be something relating to calls. The teams backend seems to get stuck in a loop triggering itself. I've caught an strace of when it's broken, it looks like this:

 # Thread B (which reads the files) is waiting on a lock
 4665  14:51:55.973754 futex(0x7f61600036f0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1592484721, tv_nsec=483743000}, FUTEX_BITSET_MATCH_ANY <unfinished ...>
 # Thread A gets a message to wake up. What the epoll is doing is unclear.
 # Note: FD72 = /sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/AC/online
 # Note: FD47&48 are the two sides of a pipe
 32114 14:51:55.973764 read(47, "\0", 100) = 1
 32114 14:51:55.973787 read(47, 0x7f6169493500, 100) = -1 EAGAIN (Resource temporarily unavailable)
 32114 14:51:55.973809 epoll_ctl(46, EPOLL_CTL_MOD, 72, {EPOLLPRI|EPOLLET, {u32=3356329872, u64=140053649917840}}) = 0
 32114 14:51:55.973831 epoll_wait(46, [{EPOLLPRI|EPOLLERR, {u32=3356329872, u64=140053649917840}}], 32, -1) = 1
 32114 14:51:55.973853 read(47, 0x7f6169493500, 100) = -1 EAGAIN (Resource temporarily unavailable)
 # Thread A wakes thread B, fiddle some locks (RWLock maybe?)
 32114 14:51:55.973875 futex(0x7f61600036f0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
 4665  14:51:55.973888 <... futex resumed> ) = 0
 32114 14:51:55.973897 <... futex resumed> ) = 1
 4665  14:51:55.973904 futex(0x7f61600036a0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
 32114 14:51:55.973911 futex(0x7f61600036a0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
 4665  14:51:55.973919 <... futex resumed> ) = -1 EAGAIN (Resource temporarily unavailable)
 32114 14:51:55.973926 <... futex resumed> ) = 0
 4665  14:51:55.973934 futex(0x7f61600036a0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
 # Thread A goes to sleep
 32114 14:51:55.973941 epoll_wait(46,  <unfinished ...>
 4665  14:51:55.973953 <... futex resumed> ) = 0
 # Thread B gets info about power supply and CPU governer
 4665  14:51:55.973966 openat(AT_FDCWD, "/sys/class/power_supply/AC/online", O_RDONLY) = 70
 4665  14:51:55.973998 read(70, "1\n", 128) = 2
 4665  14:51:55.974508 read(70, "", 126) = 0
 4665  14:51:55.974531 close(70)         = 0
 4665  14:51:55.974555 openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", O_RDONLY) = 70
 4665  14:51:55.974585 read(70, "performance\n", 128) = 12
 4665  14:51:55.974610 read(70, "", 116) = 0
 4665  14:51:55.974632 close(70)         = 0
 # Thread B writes results to pipe
 4665  14:51:55.974655 write(48, "\0", 1) = 1
 # This wakes Thread A, which causes the cycle to repeat
 32114 14:51:55.973742 <... epoll_wait resumed> [{EPOLLIN, {u32=0, u64=0}}], 32, -1) = 1
 --- repeat ---
 4665  14:51:55.973754 futex(0x7f61600036f0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {tv_sec=1592484721, tv_nsec=483743000}, FUTEX_BITSET_MATCH_ANY <unfinished ...>
 32114 14:51:55.973764 read(47, "\0", 100) = 1
 32114 14:51:55.973787 read(47, 0x7f6169493500, 100) = -1 EAGAIN (Resource temporarily unavailable)
 32114 14:51:55.973809 epoll_ctl(46, EPOLL_CTL_MOD, 72, {EPOLLPRI|EPOLLET, {u32=3356329872, u64=140053649917840}}) = 0
 32114 14:51:55.973831 epoll_wait(46, [{EPOLLPRI|EPOLLERR, {u32=3356329872, u64=140053649917840}}], 32, -1) = 1
 32114 14:51:55.973853 read(47, 0x7f6169493500, 100) = -1 EAGAIN (Resource temporarily unavailable)

etc etc etc

Hope this helps identify the problem...

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MarianJavorkaMSFT avatar image
0 Votes"
MarianJavorkaMSFT answered ·

@RodeKater-6917 @BenWerthmann-2645 thanks again for your help with logs and debug details. We released new insiders version yesterday (version 1.3.00.16851) and this version should have fixes in this area. Can you maybe try out this version and see if it helps? Alternatively, if you don't want to go to insiders and want to stick with Preview version, this should get updated next week

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.