IBM Support

Latency Sensitive Process/thread or flex latency

White Papers


Abstract

The dispatch latency is simply the time it takes for a thread to be dispatched onto a CPU after being made runnable. Therefore, dispatch latency is directly related to the number of runnable threads on the ready queue list and a runnable thread's position in that list.The flex_latency or latency sensitive process/thread support is mechanism by which time it takes for a thread to be dispatched onto a CPU after being made runnable is reduced. This will be usually set to Stock ticker or Day-trade applications

Content

AIX will support a new environment variable: RT_FLEXLATENCY=ON . Setting the environment variable will designate a process and its threads as latency sensitive. A new system call flexctl(), is provided to allow an application to set a process or a thread latency sensitive attribute by specifying a boost level. A new schedo tunable flex_latency, is introduced that will allow the dynamic activation and disabling of the boost latency dispatch policy.



# schedo -h flex_latency
Help for tunable flex_latency:
Purpose:
Enable boost latency dispatch policy.
Values:
        Default: 0
        Range: 0, 1
        Type: Dynamic
        Unit: boolean
Tuning:
A value of 0 indicates no boost latency support.
A value of 1 indicates boost latency support.

(0) root @ pure38: /
# schedo -L  flex_latency
NAME                      CUR    DEF    BOOT   MIN    MAX    UNIT           TYPE
     DEPENDENCIES
--------------------------------------------------------------------------------
flex_latency              0      0      0      0      1      boolean           D
--------------------------------------------------------------------------------

(0) root @ pure38: /
# 


Enable boost latency dispatch policy :

# schedo -o flex_latency=1
Setting flex_latency to 1
Warning: a restricted tunable has been modified

(0) root @ pure38: /
# schedo -L  flex_latency
NAME                      CUR    DEF    BOOT   MIN    MAX    UNIT           TYPE
     DEPENDENCIES
--------------------------------------------------------------------------------
flex_latency              1      0      0      0      1      boolean           D
--------------------------------------------------------------------------------

(0) root @ pure38: /
# export RT_FLEXLATENCY=ON

(0) root @ pure38: /
# ./trace_test &
[1]     6291994

(0) root @ pure38: /
# kdb
           START              END <name>
0000000000001000 0000000007140000 start+000FD8
F00000002FF47600 F00000002FFE1000 __ublock+000000
000000002FF22FF4 000000002FF22FF8 environ+000000
000000002FF22FF8 000000002FF22FFC errno+000000
F1001104C0000000 F1001104D0000000 pvproc+000000
F1001104D0000000 F1001104D8000000 pvthread+000000
read vscsi_scsi_ptrs OK, ptr = 0xF100091590128E90
(0)> tpid -d 6291994
                SLOT NAME     STATE    TID PRI   RQ CPUID  CL  WCHAN

pvthread+121200 4626 trace_te SLEEP 212020F 044    0         0  F1000C01C080E8B0 

(0)> th pvthread+121200 | grep LEAT
(0)> th pvthread+121200 | grep LATENCY
FLAGS............... TWAKEONSIG WAKEONCHKPT /  /  MCR_CREATED /  LATENCY
(0)> th pvthread+121200 | grep boost
.............boosted :00000000  ...............wchan :F1000C01C0801EB0
......boost_cnt_lock :0000      .....boost_cnt_other :0000
..flexctl boost type :00000001  .........boost level :00000007
(0)>

#  unset RT_FLEXLATENCY

(0)
# ./nonboostedth &
[2]     7209712

(0) root @ pure38: /
# kdb
           START              END <name>
0000000000001000 0000000007140000 start+000FD8
F00000002FF47600 F00000002FFE1000 __ublock+000000
000000002FF22FF4 000000002FF22FF8 environ+000000
000000002FF22FF8 000000002FF22FFC errno+000000
F1001104C0000000 F1001104D0000000 pvproc+000000
F1001104D0000000 F1001104D8000000 pvthread+000000
read vscsi_scsi_ptrs OK, ptr = 0xF100091590128E90
(0)> tpid -d 7209712
                SLOT NAME     STATE    TID PRI   RQ CPUID  CL  WCHAN

pvthread+121800 4632 nonboost SLEEP 218024D 044    0         0  F1000C01C58920B0 

(0)> th pvthread+121800 | grep LATENCY
(0)> th pvthread+121800 | grep LAT
(0)> th pvthread+121800 | grep DATA
DATA.........pvprocp :F1001104C021B800 <pvproc+21B800>
DATA...........procp :F1000C1F113CC800 <F1000C1F113CC800>
(0)> p F1001104C021B800  | grep LAT
(0)> th pvthread+121800 | grep boost
pvthread+121800 4632 nonboost SLEEP 218024D 044    0         0  F1000C01C08012B0 
NAME................ nonboostedth
.............boosted :00000000  ...............wchan :F1000C01C08012B0
......boost_cnt_lock :0000      .....boost_cnt_other :0000
..flexctl boost type :00000000  .........boost level :00000000
(0)> 




Note :It is recommended that DPO and flex_latency should not be used the same time as 
the logical partition undergoes dynamic platform optimisation and flex_latency might hit 
the synchronisation issues.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Author: Chetan Gaonkar

Operating System: AIX and VIOS

Hardware: Power

Feedback: aix_feedback@wwpdl.vnet.ibm.comcgaonkar@in.ibm.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[{"code":"a8m0z0000001fMuAAI","label":"AIX General Support"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1.0;7.2.0"}]

Document Information

Modified date:
26 June 2021

UID

ibm16467485