PQOS(8)
π pqos(8) β System Manager's Manual π
okay bestie, welcome to the pqos(8) manual. if you're here, you're probably trying to make your CPU behave, and honestly? slay. this is the Intel(R) Resource Director Technology/AMD PQoS monitoring and control tool β aka the thing that lets you stalk and boss around your cache and memory bandwidth. let's get into it. β¨
β¨ NAME β¨
pqos, pqos-msr, pqos-os β Intel(R) Resource Director Technology/AMD PQoS monitoring and control tool.
π SYNOPSIS π
pqos [OPTIONS]...
π¦ DESCRIPTION π¦
Intel(R) Resource Director Technology/AMD PQoS is designed to monitor and manage cpu resources and improve performance of applications and virtual machines. no cap, it's the whole point. π
Intel(R) Resource Director Technology/AMD PQoS includes monitoring and control technologies. Monitoring technologies include CMT (Cache Monitoring Technology), which monitors occupancy of last level cache, and MBM (Memory Bandwidth Monitoring). Control technologies include CAT (Cache Allocation Technology), CDP (Code Data Prioritization), MBA (Memory Bandwidth Allocation) and SMBA (Slow Memory Bandwidth Allocation). so you're getting both the tea and the power to change it. iconic. π
pqos supports CMT and MBM on a per core or hardware thread basis. MBM supports two types of events reporting local and remote memory bandwidth. pqos-msr and pqos-os are simple pqos wrapper scripts that automatically select the MSR or OS/Kernel library interface to program the technologies. Please see the -I option below for more information.
For hardware information please refer to the README located on: https://github.com/intel/intel-cmt-cat/blob/master/README
π OPTIONS π
pqos options are as follow:
-h,--helpβ show help. the "help me bestie" button. π-v,--verboseβ verbose mode. gives you the chatty version of everything. β-V,--super-verboseβ super-verbose mode. okay this is the "tell me EVERYTHING" mode. π-l FILE,--log-file=FILEβ log messages into selected log FILE. dump the receipts into FILE. π-s,--showβ show the current allocation and monitoring configuration. a little snapshot of what's going on. πΈ-d,--displayβ display supported Intel(R) Resource Director Technology/AMD PQoS capabilities. shows you what your CPU can actually do. β¨-D,--display-verboseβ display supported Intel(R) Resource Director Technology/AMD PQoS capabilities in verbose mode. same as above but with extra lore. π-f FILE,--config-file=FILEβ load commands from selected configuration FILE. read your pre-planned moves from FILE. π-e CLASSDEF,--alloc-class=CLASSDEFβ bestie, this is where you define the allocation classes on all CPU sockets. lowkey the main event. CLASSDEF format is"TYPE:ID=DEFINITION;...". and if you want to be specific, define classes for selected CPU resources β CLASSDEF format is"TYPE[@RESOURCE_ID]:ID=DEFINITION;...". For CAT, TYPE is"llc"for the last level cache (aka l3) and"l2"for level 2 cache, ID is a CLOS number and DEFINITION is a bitmask. For MBA, TYPE is"mba", ID is a CLOS number and DEFINITION is a value between 1 and 100 representing the percentage of available memory bandwidth. For MBA CTRL, TYPE is"mba_max", ID is a CLOS number and DEFINITION is a value representing the requested memory bandwidth specified in MBps. For SMBA, TYPE is"smba", ID is a CLOS number and DEFINITION is a value between 1 and 100 representing the percentage of available slow memory bandwidth. RESOURCE_ID is a unique number that can represent a socket or l2/l3 cache identifier. The RESOURCE_ID for each logical CPU can be found using"pqos -s".- Note: When L2/L3 CDP is on, ID can be postfixed with
'D'for data or'C'for code. - Note: L2/L3 CDP is available on selected CPUs only.
- Note: MBA CTRL is supported only by the OS interface and requires Linux and kernel version 4.18 or newer.
- Some examples:
"-e llc:0=0xffff;llc:1=0x00ff""-e llc@0-1:2=0xff00;l2:2=0x3f;l2@2:1=0xf""-e llc:0d=0xfff;llc:0c=0xfff00""-e l2:0d=0xf;l2:0c=0xc""-e mba:1=30;mba@1:3=80""-e smba:1=64;mba@1:3=128""-e mba_max:1=6000;mba_max@1:3=10000"
- Note:
"-e l2:2=0x3f"means that COS2 for all L2 cache clusters is changed to 0x3f."-e l2@2:1=0xf"means that COS1 for L2 cache cluster 2 is changed to 0xf."-e mba:1=30"means that COS1, on all sockets, can utilize up to 30% of available memory bandwidth."-e smba:1=64"means that COS1, on all sockets, can utilize up to 64 units of available slow memory bandwidth."-e mba_max:1=6000"means that COS1, on all sockets, can utilize up to 6000 MBps of memory bandwidth.
- Note: When L2/L3 CDP is on, ID can be postfixed with
-a CLASS2ID,--alloc-assoc=CLASS2IDβ this one associates allocation classes with cores or processes β like matching your faves to their VIP sections. π CLASS2ID format is"TYPE:ID=CORE_LIST;..."or"TYPE:ID=TASK_LIST;...". For COS association required for CAT or MBA, TYPE is"cos","llc","core"(for COS-core association) or"pid"(for COS-process association) and ID is a class number. CORE_LIST is comma or dash separated list of cores. TASK_LIST is comma or dash separated list of process/task ID's.- For example:
"-a cos:0=0,2,4,6-10;cos:1=1;"associates cores 0, 2, 4, 6, 7, 8, 9, 10 with CAT class 0 and core 1 with class 1."-a llc:0=0,2,4,6-10;llc:1=1;"associates cores 0, 2, 4, 6, 7, 8, 9, 10 with CAT class 0 and core 1 with class 1."-a core:0=0,2,4,6-10;core:1=1;"associates cores 0, 2, 4, 6, 7, 8, 9, 10 with CAT class 0 and core 1 with class 1."-I -a pid:0=3543,7643,4556;pid:1=7644;"associates process ID 3543, 7643, 4556 with CAT class 0 and process ID 7644 with class 1.
- Notes:
"llc"TYPE label is considered deprecated, please use"cos"or"core"instead.- The
-Ioption must be used for PID association.
- For example:
-R [CONFIG[,CONFIG]],--alloc-reset[=CONFIG[,CONFIG]]β reset allocation setting (L3 CAT, L2 CAT, MBA) and reconfigure allocation β factory reset but make it fashion. CONFIG is one of the following options:l3cdp-onsets L3 CDP onl3cdp-offsets L3 CDP offl3cdp-anykeeps current L3 CDP setting (default)l3iordt-onsets L3 I/O RDT onl3iordt-offsets L3 I/O RDT offl3iordt-anykeeps current L3 I/O RDT setting (default)l2cdp-onsets L2 CDP onl2cdp-offsets L2 CDP offl2cdp-anykeeps current L2 CDP setting (default)mbaCtrl-onsets MBA CTRL onmbaCtrl-offsets MBA CTRL offmbaCtrl-anykeeps current MBA CTRL setting (default)mba40-onenables MBA 4.0 extensions for all socketsmba40-offdisables MBA 4.0 extensions for all socketsmba40-anykeeps current MBA 4.0 setting (default)
-m EVTCORES,--mon-core=EVTCORESβ pick your cores and events for monitoring β the vibe check of your CPU. EVTCORES format is"EVENT:CORE_LIST". Valid EVENT settings are:"llc"for CMT (LLC occupancy)"mbr"for MBR (remote memory bandwidth)"mbl"for MBL (local memory bandwidth)"mbt"for MBT (total memory bandwidth)"all"or""for all detected event types (except MBT)- AET telemetry is excluded and must be requested explicitly via
"cr_en","act","pow"or"aet" "cr_en"for Core Energy (OS interface only)"act"for Activity Counter (OS interface only)"pow"for Power derived from Core Energy (OS interface only)"aet"alias for cr_en+act+pow (OS interface only) CORE_LIST is comma or dash separated list of cores. Example"-m all:0,2,4-10;llc:1,3;mbr:11-12". Core statistics can be grouped by enclosing the core list in square brackets. Example"-m llc:[0-3];all:[4,5,6];mbr:[0-3],7,8".
-p [EVTPIDS],--mon-pid[=EVTPIDS]β select top 10 most active (CPU utilizing) process ids to monitor or select the process ids and events to monitor β stalk your busiest processes. fr fr. EVTPIDS format is"EVENT:PID_LIST". See-moption for valid EVENT settings. PID_LIST is comma separated list of process ids.- Examples:
"-p llc:22,25673""-p all:892,4588-4592"
- Process's IDs can be grouped by enclosing them in square brackets.
- Examples:
"-p llc:[22,25673]""-p all:892,[4588-4592]"
- Note:
- Requires Linux and kernel versions 4.10 and newer.
- The
-Ioption must be used for PID monitoring. - It is not possible to track both processes and cores at the same time.
- Examples:
--mon-uncore[=EVTUNCORE]β select sockets and uncore events for monitoring β uncore? we don't know her, but we monitor her. iykyk. EVTUNCORE format is'EVENT:SOCKET_LIST. Socket's IDs can be grouped by enclosing them in square brackets.- Examples:
"--mon-uncore""--mon-uncore=all:0"
- Note: It is not possible to track both sockets and cores at the same time.
- Examples:
-T,--mon-topβ enable top like monitoring output sorted by highest LLC occupancy β it's givingtopbut for cache. main character energy. π--mon-dev=EVTDEVICES"β select I/O RDT devices and events to monitor β device spy era. not me being nosy. EVTDEVICES format is See-moption for valid EVENT settings. DEVICE_LIST is comma separated list of I/O RDT devices.- Examples:
"--mon-dev all:0000:0010:04.0@1""--mon-dev llc:0000:0010:05.0"
- Examples:
--mon-channel=EVTCHANNELSβ select I/O RDT channels and events to monitor β channel your inner monitor. periodt. EVTCHANNELS format is See-moption for valid EVENT settings. CHANNEL_LIST is comma separated list of I/O RDT channels. Channels can be grouped by enclosing them in square brackets.-o FILE,--mon-file FILEβ picks the outputFILEwhere your monitored data goes. default is'stdout'bestie, so it just spills onto your screen unless you say otherwise π-u TYPE,--mon-file-type=TYPEβ chooses the output formatTYPEfor the monitored data. SupportedTYPEsettings are:"text"(the default, she's the moment),"xml"and"csv". pick your fighter β¨-i INTERVAL,--mon-interval=INTERVALβ sets the monitoring samplingINTERVAL, measured in units of 100ms. so1= 100ms, and default10= 10x100ms = 1s. no cap π-t SECONDS,--mon-time=SECONDSβ how long to monitor, in seconds. use'inf'or'infinite'for infinite monitoring, main character energy fr. and you can hit Ctrl+C to stop monitoring at literally any time π-r,--mon-reset[=CONFIG[,CONFIG]]β resets monitoring, uses all the RMID's in the system, and reconfigures allocation.CONFIGis one of these:l3iordt-onβ sets L3 I/O RDT onl3iordt-offβ sets L3 I/O RDT offl3iordt-anyβ keeps the current L3 I/O RDT setting (this is the default)
--disable-mon-ipcβ turns off IPC monitoring π«--disable-mon-llc_missβ turns off LLC misses monitoring π«-H,--profile-listβ lists the supported allocation profiles π-c PROFILE,--profile-set=PROFILEβ selects aPROFILEfrom the predefined allocation classes. use-Hto see what profiles are available π-I,--iface-osβ sets the library interface to the kernel implementation (same as--iface=os). and okay so when you give neither-Inor--iface, the tool now infers the interface automatically from the other options on the command line (preference order:mmio>msr>os) β¨--iface=INTERFACEβ overrides the auto-detected library interface.INTERFACEcan be'auto','msr','os'or'mmio'. with'auto'(or when--ifaceis omitted entirely) the interface gets picked automatically from the options you asked for. and if your options imply two incompatible interfaces?? the tool just fails with a clear error message naming the conflicting options. it's giving "we don't do mixed signals here" π
The auto-detection rules are:
- Options that only work under MMIO (e.g.
--print-mem-regions,--print-topology,--dump,--alloc-domain-id,--alloc-mem-regions, ...) force the MMIO interface. -p/--mon-pid(and PID-based--alloc-assoc) force the OS interface.--mon-channel,--mon-dev,--rmidand--rmid-channelsrestrict the choice to MSR or MMIO.--print-io-devsand--print-io-devrestrict the choice to MSR or MMIO.-m/--mon-uncoreeventscr_en,act,powandaetrestrict the choice to OS.-R/--alloc-resetvaluescdp-on/cdp-offandl2cdp-on/l2cdp-off/l3cdp-on/l3cdp-offrestrict the choice to MSR or OS.-r/--mon-resetvaluesl3iordt-on/l3iordt-offand-R/--alloc-resetvaluesl3iordt-on/l3iordt-offrestrict the choice to MSR or MMIO.- When several interfaces remain valid, the preference order is
mmio>msr>os. - When no option constrains the interface, the library's own auto-detection is used:
- Takes the
RDT_IFACEenvironment variable into account if it is set - Selects the MMIO interface if supported (ERDT and MRRM ACPI tables present)
- Selects the OS interface if the kernel interface is supported
- Selects the MSR interface otherwise
- Takes the
π NOTES π
So CMT, MBM and CAT are all configured using Model Specific Registers (MSRs). The pqos software runs in user space, and it gets access to the MSRs through a standard Linux* interface, iykyk. The msr file interface is protected and requires root privileges. Also the msr driver might not be auto-loaded, and on some modular kernels you gotta load the driver manually: π
For Linux:
sudo modprobe msr
For FreeBSD:
sudo kldload cpuctl
Interface enforcement: if you need system wide interface enforcement (fancy, I know π
) you can do it by setting the "RDT_IFACE" environment variable.
π SEE ALSO π
π AUTHOR π
pqos was written by Tomasz Kantecki <tomasz.kantecki@intel.com>, Marcel Cornu <marcel.d.cornu@intel.com>, Aaron Hetherington <aaron.hetherington@intel.com>, Michal Aleksinski <michalx.aleksinski@intel.com>, Wojciech Andralojc <wojciechx.andralojc@intel.com>, Adrian Boczkowski <adrianx.boczkowski@intel.com>. legends, all of them, we stan π«Ά
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. not a single one bestie, read the fine print π
and that's a wrap on PQOS(8) π this page is from Apr 19, 2022, section 8 of the manual, and yeah she's been slaying since then. go monitor something responsibly, mwah π
π¦ where this page comes from
- nixpkgs unstable: intel-cmt-cat 26.06
- ubuntu stonking: intel-cmt-cat 26.06-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms