Skip to content

Usage Examples

mdcornu edited this page May 11, 2017 · 12 revisions

NOTE: Must be run as root.

Cache Monitoring Technology (CMT) and Memory B/W Monitoring (MBM) usage:

  • Monitor all events on cores 0 to 11:

pqos -m all:0-11
pqos -m :0-11

  • Monitor LLC on cores 0, 2 and 6:

pqos -m llc:0,2,6

  • Monitor local memory B/W on cores 0-2 and remote memory B/W on cores 3, 4 and 5:

pqos -m "mbl:0-2;mbr:3,4,5"

  • Monitor events on groups of cores (aggregate statistics):

pqos -m "all:[0-11];llc:[12,13,14];mbl:[15-17,20]"

  • Monitor all events for PID's 43523, 43589 and 3245 to 3252:

pqos -p all:43523,43589,3245-3252

  • Reset Monitoring:

Reclaims in-use RMID's.
pqos -r

Example CMT/MBM usage scenario

A user has a host machine running 3 guest VM's with 3 cores assigned to each guest.

  • VM0 - cores 0-2
  • VM1 - cores 3-5
  • VM2 - cores 6-8

To monitor all events (LLC occupancy, local and remote memory B/W) run:
pqos -m "all:[0-2],[3-5],[6-8];"

Console output:

CORE    IPC   MISSES    LLC[KB]  MBL[MB/s]  MBR[MB/s]    
 0-2   0.28    7893k      383.2      901.2      430.8   
 3-5   0.28      45k       25.3   361282.6       22.4   
 6-8   0.26   89468k     6778.8    43904.3        4.3   

Cache Allocation Technology (CAT) usage:

  • Set COS 1 to the first 4 cache ways and COS 2 to the next 8 cache ways:

pqos -e "llc:1=0x000f;llc:2=0x0ff0;"

  • Set COS 1 on all sockets, COS 2 on socket 0 and 1 and COS 3 on sockets 2 to 3:

pqos -e "llc:1=0x000f;llc@0,1:2=0x0ff0;llc@2-3:3=0x3c"

Console output for pqos -s to show current configuration:

L3CA COS definitions for Socket 0:   
    L3CA COS0 => MASK 0xfffff   
    L3CA COS1 => MASK 0xf   
    L3CA COS2 => MASK 0xff0   
    L3CA COS3 => MASK 0xfffff   
    ...   
L3CA COS definitions for Socket 1:   
    L3CA COS0 => MASK 0xfffff   
    L3CA COS1 => MASK 0xf   
    L3CA COS2 => MASK 0xff0   
    L3CA COS3 => MASK 0xfffff   
    ...   
L3CA COS definitions for Socket 2:   
    L3CA COS0 => MASK 0xfffff   
    L3CA COS1 => MASK 0xf   
    L3CA COS2 => MASK 0xfffff   
    L3CA COS3 => MASK 0x3c   
    ...   
L3CA COS definitions for Socket 3:   
    L3CA COS0 => MASK 0xfffff   
    L3CA COS1 => MASK 0xf   
    L3CA COS2 => MASK 0xfffff   
    L3CA COS3 => MASK 0x3c   
    ...    
  • Associate cores 0, 2, and 6 to 10 with COS 1 and core 1 to COS 2:

pqos -a "llc:1=0,2,6-10;llc:2=1;"

  • Enable, disable L3 CDP (v0.1.5+):

pqos -R l3cdp-on
pqos -R l3cdp-off

  • Enable, disable L3 CDP (v0.1.4):

pqos -S cdp-on
pqos -S cdp-off

  • Use current L3 CDP settings and set COS 1 code and data bitmasks (v0.1.5+):

pqos -e "llc:1d=0xfff;llc:1c=0xfff00;"

  • Use current L3 CDP settings and set COS 1 code and data bitmasks (v0.1.4):

pqos -S cdp-any -e "llc:1d=0xfff;llc:1c=0xfff00;" or pqos -e "llc:1d=0xfff;llc:1c=0xfff00;"

  • Show current CAT settings:

pqos -s

  • Reset CAT:

Sets all COS to default (fill into all ways) and associates all cores with COS 0.
pqos -R

Example CAT usage scenario

A user has a host machine running 3 guest VM's. Each guest is assigned 3 cores and a priority.

  • VM0 - cores 0-2 (P5)
  • VM1 - cores 3-5 (P2)
  • VM2 - cores 6-8 (P1)

As VM0 has the highest priority it will be assigned 8 exclusive LLC ways. VM1 and VM2 are relatively low priority so VM1 is assigned 6 ways and VM2 is assigned 4 ways, 2 of which will be shared.

  • First, set the 3 COS bitmasks for each VM:
    pqos -e "llc:1=0x00ff;llc:2=0x3f00;llc:3=0xf000;"

  • Next, associate each COS with the cores where each VM is running:
    pqos -a "llc:1=0-2;llc:2=3-5;llc:3=6-8;"

VM 0 now has exclusive access to 8 LLC ways, VM1 has exclusive access to 4 ways and shared access to 2 ways and VM2 has exclusive access to 2 ways and shared access to another 2 ways. All other cores have access to all other ways.


Memory Bandwidth Allocation (MBA) usage:

  • Set COS 1 to 50% available and COS 2 to 70% available:

pqos -e "mba:1=50;mba:2=70;"

  • Set COS 1 on all sockets, COS 2 on socket 0 and 1 and COS 3 on sockets 2 to 3:

Note: MBA rounds numbers given to it.
pqos -e "mba:1=80;mba@0,1:2=64;mba@2-3:3=85"

Console output for pqos -s to show current configuration:

L3CA/MBA COS definitions for Socket 0:   
    MBA COS0 => 100% available   
    MBA COS1 => 80%  available   
    MBA COS2 => 60%  available   
    MBA COS3 => 100% available   
    ...   
L3CA/MBA COS definitions for Socket 1:   
    MBA COS0 => 100% available   
    MBA COS1 => 80%  available   
    MBA COS2 => 60%  available   
    MBA COS3 => 100%  available    
    ...   
L3CA/MBA COS definitions for Socket 2:   
    MBA COS0 => 100% available   
    MBA COS1 => 80%  available   
    MBA COS2 => 100%  available   
    MBA COS3 => 90%  available 
    ...   
L3CA/MBA COS definitions for Socket 3:   
    MBA COS0 => 100% available   
    MBA COS1 => 80%  available   
    MBA COS2 => 100%  available   
    MBA COS3 => 90%  available  
    ...    
  • Show current MBA settings:

pqos -s

  • Reset MBA:

Sets all COS to default and associates all cores with COS 0.
pqos -R

Clone this wiki locally