美文网首页
Ubuntu18.04 cpu温度过高-kworker占用cpu

Ubuntu18.04 cpu温度过高-kworker占用cpu

作者: 田丰w | 来源:发表于2021-12-01 15:02 被阅读0次

    背景

    日常开发用笔记本, ubuntu18.04, 风扇呼呼转, 吵得很.

    就算啥也不干, cpu温度也维持在 75°以上. 参考资料报告这是Ubuntu18的一个bug,后续版本已修复

    检查cpu占用, 一个 kworker 进程的cpu占用一直维持在 90% 左右.

    解决办法

    # 先切 root 用户
    echo "disable" > /sys/firmware/acpi/interrupts/gpe6F
    

    (这个语句再次执行会报错)

    看看效果. cpu温度维持在 45° 以下

    这个命令不是永久的, 重启后失效

    把指令配置为开机启动

    Ubuntu18 使用 systemd 管理开机服务,这里写的 rc.local 脚本还要用 systemd 管理

    sudo vim /etc/rc.local

    #!/bin/bash
    # 用户手动创建的开机执行的命令
    
    # fix kworker cpu load high
    echo "disable" > /sys/firmware/acpi/interrupts/gpe6F
    

    sudo chmod +x /etc/rc.local

    sudo vim /etc/systemd/system/rc-local.service

    #  SPDX-License-Identifier: LGPL-2.1+  
    #  
    #  This file is part of systemd.  
    #  
    #  systemd is free software; you can redistribute it and/or modify it  
    #  under the terms of the GNU Lesser General Public License as published by  
    #  the Free Software Foundation; either version 2.1 of the License, or  
    #  (at your option) any later version.  
    
    # This unit gets pulled automatically into multi-user.target by  
    # systemd-rc-local-generator if /etc/rc.local is executable.  
    [Unit]
    Description=/etc/rc.local Compatibility
    Documentation=man:systemd-rc-local-generator(8)
    ConditionFileIsExecutable=/etc/rc.local
    After=network.target
    
    [Service]
    Type=forking
    ExecStart=/etc/rc.local
    TimeoutSec=0
    RemainAfterExit=yes
    GuessMainPID=no
    
    [Install]
    WantedBy=multi-user.target
    
    

    重新加载配置
    sudo systemctl daemon-reload

    启动服务
    sudo systemctl start rc-local.service

    设置开机启动
    sudo systemctl enable rc-local.service

    参考

    相关文章

      网友评论

          本文标题:Ubuntu18.04 cpu温度过高-kworker占用cpu

          本文链接:https://www.haomeiwen.com/subject/uyssxrtx.html