Skip to content

Latest commit

 

History

History
42 lines (35 loc) · 1.88 KB

README.org

File metadata and controls

42 lines (35 loc) · 1.88 KB

Legiond

Why legiond

legiond daemon is made to solve the following problems:

legion_cli being triggered multiple times in a short period

We used to use path to trigger the fancurve-set script, which could result in reaching systemd limits.

We don’t have to trigger it every time, just need to make sure it gets triggered last time.

Unpersistent cpu tweaks

We observed that after running for a while, undervolt and ryzenadj tweaks to the cpu may not work.

To solve that, We introduce a systemd.timer to run cpu tweaks every 30s. Because we use legiond-ctl, if a fancurve-set task is to start, it will refresh the timer of legiond. This avoids non-essential fancurve-set being run.

Power state change on resume prevent fancurve-set from setting correct fancurve

Now we use a 3s delay to make sure it works fine. Every power-state/power-profile change will reset the timer.

How it works

legiond is divided into two parts, legiond and legiond-ctl. legiond is running as a systemd.service, legiond-ctl is a bridge between legiond-cpuset.service and legiond-resume.service with legiond.service.

legiond-cli send request to legiond via Unix domain socket.

When the power-state or power-profile changed, acpid.service send a request to legiond via legiond-ctl. legiond will call a series of utils after a variable delay(depend on legiond-ctl arguments).

Configuration

sudo cp /usr/share/legion_linux/{*.yaml,legiond.ini} /etc/legion_linux/

Edit fancurve profile .yaml to fit your needs.

Modify /etc/legion_linux/legiond.ini with your favorate editor.

Enable systemd.service:

systemctl enable --now legiond.service legiond-onresume.service legiond-cpuset.timer

TODO

  • [X] fancurve control
  • [X] cpu control
  • [ ] freshrate control