c0pin is a Linux CPU performance and latency tuner.
It provides explicit CPU performance policies for systems where predictable CPU responsiveness is more important than power efficiency.
c0pin configures Linux kernel interfaces such as cpufreq, Intel pstate, amd-pstate, CPU boost controls, and CPU DMA latency QoS.
sudo c0pin --performance-policyThis mode:
- Sets the cpufreq governor to
performance - Sets EPP to
performancewhere supported - Verifies the requested configuration
- Exits after applying the policy
This mode does not modify:
- CPU turbo state
- CPU boost state
- CPU idle or C-state behavior
- CPU DMA latency QoS
sudo c0pin --aggressiveAggressive mode applies the performance policy and additionally configures more aggressive CPU performance settings where supported.
On Intel systems using Intel pstate, c0pin attempts to:
- Enable turbo operation
- Set maximum performance percentage to
100
It also attempts to:
- Enable the kernel CPU boost mechanism
- Set the cpufreq maximum frequency to
cpuinfo_max_freq - Set the minimum frequency to the maximum frequency for drivers other than
amd-pstate
Aggressive mode also acquires a CPU DMA latency QoS constraint through:
/dev/cpu_dma_latency
The default latency bound is:
0 microseconds
A custom latency value can be supplied:
sudo c0pin --aggressive 100The DMA latency constraint remains active while c0pin is running.
Clone the repository:
git clone https://github.com/psaux-it/c0pin.git
cd c0pinBuild:
makeInstall:
sudo make installThe default installation paths are:
/usr/local/sbin/c0pin
/usr/local/share/man/man8/c0pin.8
/usr/local/share/doc/c0pin/LICENSE
/etc/systemd/system/c0pin-performance.service
/etc/systemd/system/c0pin-aggressive.service
After installation:
man 8 c0pinc0pin provides two independent operating modes. Choose the mode that matches your requirements. You do not need to run both modes.
Use this mode for a performance-oriented CPU policy without aggressive tuning or CPU DMA latency QoS:
sudo c0pin --performance-policyc0pin applies the performance policy and exits. The configured CPU policy remains in effect until it is changed by another component or explicitly reconfigured.
Use this mode when you also want the Performance Policy, aggressive CPU performance controls, and a CPU DMA latency QoS constraint:
sudo c0pin --aggressiveAggressive mode runs in the foreground while the DMA latency constraint is held.
When aggressive mode terminates, the DMA latency file descriptor is closed and the associated QoS constraint is released.
Two systemd service units are provided.
Start:
sudo systemctl start c0pin-performance.serviceEnable at boot:
sudo systemctl enable c0pin-performance.serviceCheck status:
systemctl status c0pin-performance.serviceThis is a oneshot service. c0pin applies the requested policy and exits.
The configured CPU policy remains in effect until it is changed by another
component or explicitly reconfigured.
Start:
sudo systemctl start c0pin-aggressive.serviceEnable at boot:
sudo systemctl enable c0pin-aggressive.serviceCheck status:
systemctl status c0pin-aggressive.serviceStop:
sudo systemctl stop c0pin-aggressive.serviceThe aggressive service remains active while c0pin holds the CPU DMA latency QoS constraint.
The two provided services conflict with each other and are not intended to run simultaneously.
If installed with the Makefile:
sudo make uninstallIf a service was enabled previously, disable it before uninstalling:
sudo systemctl disable c0pin-performance.service
sudo systemctl disable c0pin-aggressive.serviceThen reload systemd:
sudo systemctl daemon-reloadThe Makefile supports standard installation overrides.
For example:
make PREFIX=/usrOr:
make DESTDIR=/tmp/c0pin-package PREFIX=/usr installThe systemd unit directory can also be overridden:
make UNITDIR=/usr/lib/systemd/system installc0pin does not save and restore the previous CPU configuration.
CPU settings changed by c0pin are not automatically reverted when the program or service exits.
For example, stopping aggressive mode releases the /dev/cpu_dma_latency
constraint, but does not automatically restore previous governor, EPP, boost,
turbo, or frequency-limit settings.
Treat c0pin as a CPU policy configuration utility rather than a temporary configuration switch.
c0pin is released under the MIT License.
Hasan CALISIR
c0pin is a Linux system utility for enforcing CPU performance-oriented policies.
It configures the CPU to favor performance over power efficiency through Linux kernel interfaces. Actual CPU frequency remains subject to hardware, firmware, thermal, power, and kernel limits.