• Recent
    • Docs
    • Github
    • 百度网盘
    • Onedrive
    • Official
    • Shop
    • Register
    • Login

    After suspend scaling_max_freq set to lowest. and some perfomance tweak

    Scheduled Pinned Locked Moved PI CM5 Laptop
    5 Posts 2 Posters 370 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • plumlisP
      plumlis
      last edited by plumlis

      I set CPU scaling_governor to schedutil for powersave.

      echo schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
      echo schedutil > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
      echo schedutil > /sys/devices/system/cpu/cpufreq/policy3/scaling_governor
      

      I found after laptop wake up from suspend.

      /sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq
      /sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq
      

      will be set to lowest 408000. That makes laptop quite laggy.

      Maybe its a bug in Kernel?

      I made a workaroud.

      sudo mkdir /usr/lib/systemd/system-sleep/
      sudo vim /usr/lib/systemd/system-sleep/cpu_freq
      

      File: /usr/lib/systemd/system-sleep/cpu_freq

      #!/bin/sh
      case $1/$2 in
        pre/*)
          echo "Going to $2..."
          # Place your pre suspend commands here, or `exit 0` if no pre suspend action required
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy3/scaling_governor
          echo 1800000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
          echo 2352000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_min_freq
          echo 2256000 > /sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy3/scaling_min_freq
          echo simple_ondemand > /sys/devices/platform/fb000000.gpu/devfreq/fb000000.gpu/governor
          ;;
        post/*)
          echo "Waking up from $2..."
          # Place your post suspend (resume) commands here, or `exit 0` if no post suspend action required
          sleep 2
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
          echo schedutil > /sys/devices/system/cpu/cpufreq/policy3/scaling_governor
          echo 1800000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
          echo 2352000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy1/scaling_min_freq
          echo 2256000 > /sys/devices/system/cpu/cpufreq/policy3/scaling_max_freq
          echo 408000 > /sys/devices/system/cpu/cpufreq/policy3/scaling_min_freq
          echo simple_ondemand > /sys/devices/platform/fb000000.gpu/devfreq/fb000000.gpu/governor
          ;;
      esac
      

      make it work

      sudo chmod 755 /usr/lib/systemd/system-sleep/cpu_freq
      

      blog: https://plumz.me

      G 1 Reply Last reply Reply Quote 0
      • G
        george @plumlis
        last edited by

        @plumlis

        Thank you for sharing.

        1 Reply Last reply Reply Quote 0
        • plumlisP
          plumlis
          last edited by plumlis

          I just found something useful about improve cool pi laptop perfomance and efficiency.

          https://github.com/ThomasKaiser/Knowledge/blob/master/articles/Quick_Preview_of_ROCK_5B.md#important-insights-and-suggested-optimisations

          I tried and it works quite well.

          Just compile kernel with CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y and use a conf file.

          blog: https://plumz.me

          G 1 Reply Last reply Reply Quote 0
          • plumlisP
            plumlis
            last edited by

            Here is more about schedutil

            https://github.com/ThomasKaiser/Knowledge/blob/master/articles/schedutil-and-EAS.md

            Seems ondemand is better choice.

            blog: https://plumz.me

            1 Reply Last reply Reply Quote 0
            • G
              george @plumlis
              last edited by

              @plumlis
              This method has been tried before, and as you said, the actual effect can be seen in the Ubuntu system. However, if it is a system with kylin and uos, it must always run in performance mode to run smoothly. We will re evaluate whether to update to the existing kernel configuration. Thank you for your suggestion.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post