#linux #intel #pstate

intel-pstate

Fetch and modify Intel pstate kernel parameters

8 releases (2 stable)

1.0.1 Feb 25, 2022
0.2.3 Nov 17, 2021
0.2.2 Apr 23, 2021
0.2.1 Apr 29, 2020
0.1.1 Dec 26, 2018

#146 in Unix APIs

Download history 136/week @ 2022-08-14 149/week @ 2022-08-21 124/week @ 2022-08-28 147/week @ 2022-09-04 131/week @ 2022-09-11 116/week @ 2022-09-18 94/week @ 2022-09-25 123/week @ 2022-10-02 103/week @ 2022-10-09 97/week @ 2022-10-16 138/week @ 2022-10-23 127/week @ 2022-10-30 140/week @ 2022-11-06 110/week @ 2022-11-13 103/week @ 2022-11-20 104/week @ 2022-11-27

474 downloads per month

MIT license

8KB
144 lines

intel-pstate

Rust crate for fetching and modifying intel_pstate kernel parameters.

use std::io;
use intel_pstate::PState;

fn main() -> io::Result<()> {
    if let Ok(pstate) = PState::new() {
        pstate.set_min_perf_pct(50)?;
        pstate.set_max_perf_pct(100)?;
        pstate.set_no_turbo(false)?;
    }

    Ok(())
}

lib.rs:

Crate for fetching and modifying the intel_pstate kernel parameters.

Example

use intel_pstate::{PState, PStateError};

fn main() -> Result<(), PStateError> {
    let pstate = PState::new()?;

    let _ = pstate.set_hwp_dynamic_boost(true);
    pstate.set_min_perf_pct(50)?;
    pstate.set_max_perf_pct(100)?;
    pstate.set_no_turbo(false)?;

    Ok(())
}

Dependencies

~0.5–1MB
~21K SLoC