Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if Linux kworker occupies too much CPU?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you the relevant knowledge about how Linux kworker takes up too much CPU. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Open HTOP first

Htop then press H K (uppercase)

We can see that Kworker/0:0+events takes up a lot of CPU, so let's refer to the answer below.

What is kworker? Kworker represents the Linux kernel process that does "work" (handling system calls). There can be multiple processes in the list: kworker/0:1 kworker/1:1 is one on the first CPU kernel, one on the second CPU kernel, and so on.

Why does kworker take up your CPU? To find out why kworker is wasting your CPU, you can create a CPU traceback: observe your processor load (with or without top) and execute it at a high load of kworker, echo l > / proc/sysrq-trigger to create a traceback. On Ubuntu, this requires you to log in to sudo-s. Do this a few times, and then observe the backtracking at the end of the dmesg output. Look at what happens frequently in CPU backtracking in the hope that it will point to the root of the problem.

Install perf

Sudo dnf install perf.aarch74 # I use Huawei Yunkunpeng arm to modify all 10s backtracking records on CPU.

Sudo perf record-g-a sleep 10 then generates a perf.data in the current directory

Use the following command to view

Sudo perf report

We see that arch_cpu_idle takes up a lot of CPU. So I asked the people in the Fedora telegram group and looked at arch/arm64/kernel/process.c.

It turns out that no other process is using CPU,Linux to automatically save CPU operations. (in the future, I will transfer my blog to my own website, zhyz.ru.)

Doesn't this mean that simply no other process is using the CPU? From what I see, this is like the "Idle task" in Windows

Add: I don't know if both threads of BUG are full now.

These are all the contents of this article "what to do if Linux kworker occupies too much CPU". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report