Files
MuditaOS/module-sys/SystemManager/doc/data/CpuFreqChangeAlgorithm.svg
Maciej Gibowicz 8d79f27d51 [EGD-5324] Add Low Power documentation
Documentation describing the Low Power control algorithm and
synchronization with the system using dedicated sentinels and drivers.
2021-02-16 09:03:21 +01:00

52 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="611px" preserveAspectRatio="none" style="width:723px;height:611px;" version="1.1" viewBox="0 0 723 611" width="723px" zoomAndPan="magnify"><defs><filter height="300%" id="f4w1gyh31egl9" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><ellipse cx="289.75" cy="20" fill="#000000" filter="url(#f4w1gyh31egl9)" rx="10" ry="10" style="stroke: none; stroke-width: 1.0;"/><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="171.25,50,408.25,50,420.25,62,408.25,74,171.25,74,159.25,62,171.25,50" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="237" x="171.25" y="65.8081">cpuLoad &gt; frequencyShiftUpperThreshold</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="20" x="139.25" y="59.4058">yes</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="14" x="420.25" y="59.4058">no</text><rect fill="#FEFECE" filter="url(#f4w1gyh31egl9)" height="47.9375" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="194" x="10" y="84"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="170" x="24" y="105.1387">aboveThresholdCounter++</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="174" x="20" y="119.1074">belowThresholdCounter = 0</text><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="354,84,591,84,603,96,591,108,354,108,342,96,354,84" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="237" x="354" y="99.8081">cpuLoad &lt; frequencyShiftLowerThreshold</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="20" x="322" y="93.4058">yes</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="14" x="603" y="93.4058">no</text><rect fill="#FEFECE" filter="url(#f4w1gyh31egl9)" height="47.9375" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="196" x="234" y="118"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="168" x="248" y="139.1387">belowThresholdCounter++</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="176" x="244" y="153.1074">aboveThresholdCounter = 0</text><rect fill="#FEFECE" filter="url(#f4w1gyh31egl9)" height="47.9375" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="198" x="514" y="118"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="174" x="528" y="139.1387">belowThresholdCounter = 0</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="176" x="524" y="153.1074">aboveThresholdCounter = 0</text><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="472.5,171.9375,484.5,183.9375,472.5,195.9375,460.5,183.9375,472.5,171.9375" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="289.75,201.9375,301.75,213.9375,289.75,225.9375,277.75,213.9375,289.75,201.9375" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="134.75,245.9375,444.75,245.9375,456.75,277.9492,444.75,309.9609,134.75,309.9609,122.75,277.9492,134.75,245.9375" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="138.75" y="256.1479"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="310" x="134.75" y="268.9526">aboveThresholdCounter &gt;= maxAboveThresholdCount</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="12" x="134.75" y="281.7573">or</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="277" x="134.75" y="294.562">minFrequencyRequested &gt; currentCpuFrequency</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="138.75" y="307.3667"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="20" x="102.75" y="275.355">yes</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="14" x="456.75" y="275.355">no</text><rect fill="#FEFECE" filter="url(#f4w1gyh31egl9)" height="75.875" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="196" x="14.75" y="319.9609"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="153" x="28.75" y="341.0996">IncreaseCpuFrequency()</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="0" x="28.75" y="355.0684"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="174" x="24.75" y="369.0371">belowThresholdCounter = 0</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="176" x="24.75" y="383.0059">aboveThresholdCounter = 0</text><rect fill="#FEFECE" filter="url(#f4w1gyh31egl9)" height="75.875" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="196" x="368.75" y="408.3867"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="159" x="382.75" y="429.5254">DecreaseCpuFrequency()</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="0" x="382.75" y="443.4941"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="174" x="378.75" y="457.4629">belowThresholdCounter = 0</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="176" x="378.75" y="471.4316">aboveThresholdCounter = 0</text><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="312.25,319.9609,621.25,319.9609,633.25,351.9727,621.25,383.9844,312.25,383.9844,300.25,351.9727,312.25,319.9609" style="stroke: #A80036; stroke-width: 1.5;"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="20" x="470.75" y="394.1948">yes</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="316.25" y="330.1714"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="309" x="312.25" y="342.9761">belowThresholdCounter &gt;= maxBelowThresholdCount</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="21" x="312.25" y="355.7808">and</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="244" x="312.25" y="368.5854">currentCpuFreq &gt; minFrequencyRequested</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="0" x="316.25" y="381.3901"/><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="466.75,504.2617,478.75,516.2617,466.75,528.2617,454.75,516.2617,466.75,504.2617" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#FEFECE" filter="url(#f4w1gyh31egl9)" points="289.75,534.2617,301.75,546.2617,289.75,558.2617,277.75,546.2617,289.75,534.2617" style="stroke: #A80036; stroke-width: 1.5;"/><ellipse cx="289.75" cy="589.2617" fill="#FFFFFF" filter="url(#f4w1gyh31egl9)" rx="11" ry="11" style="stroke: #000000; stroke-width: 1.0;"/><ellipse cx="289.75" cy="589.2617" fill="#000000" rx="6" ry="6" style="stroke: #7F7F7F; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="342" x2="332" y1="96" y2="96"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="332" x2="332" y1="96" y2="118"/><polygon fill="#A80036" points="328,108,332,118,336,108,332,112" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="603" x2="613" y1="96" y2="96"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="613" x2="613" y1="96" y2="118"/><polygon fill="#A80036" points="609,108,613,118,617,108,613,112" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="332" x2="332" y1="165.9375" y2="183.9375"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="332" x2="460.5" y1="183.9375" y2="183.9375"/><polygon fill="#A80036" points="450.5,179.9375,460.5,183.9375,450.5,187.9375,454.5,183.9375" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="613" x2="613" y1="165.9375" y2="183.9375"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="613" x2="484.5" y1="183.9375" y2="183.9375"/><polygon fill="#A80036" points="494.5,179.9375,484.5,183.9375,494.5,187.9375,490.5,183.9375" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="159.25" x2="107" y1="62" y2="62"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="107" x2="107" y1="62" y2="84"/><polygon fill="#A80036" points="103,74,107,84,111,74,107,78" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="420.25" x2="472.5" y1="62" y2="62"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="472.5" x2="472.5" y1="62" y2="84"/><polygon fill="#A80036" points="468.5,74,472.5,84,476.5,74,472.5,78" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="107" x2="107" y1="131.9375" y2="213.9375"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="107" x2="277.75" y1="213.9375" y2="213.9375"/><polygon fill="#A80036" points="267.75,209.9375,277.75,213.9375,267.75,217.9375,271.75,213.9375" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="472.5" x2="472.5" y1="195.9375" y2="213.9375"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="472.5" x2="301.75" y1="213.9375" y2="213.9375"/><polygon fill="#A80036" points="311.75,209.9375,301.75,213.9375,311.75,217.9375,307.75,213.9375" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="289.75" x2="289.75" y1="30" y2="50"/><polygon fill="#A80036" points="285.75,40,289.75,50,293.75,40,289.75,44" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="466.75" x2="466.75" y1="383.9844" y2="408.3867"/><polygon fill="#A80036" points="462.75,398.3867,466.75,408.3867,470.75,398.3867,466.75,402.3867" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="633.25" x2="645.25" y1="351.9727" y2="351.9727"/><polygon fill="#A80036" points="641.25,426.3184,645.25,436.3184,649.25,426.3184,645.25,430.3184" style="stroke: #A80036; stroke-width: 1.5;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="645.25" x2="645.25" y1="351.9727" y2="516.2617"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="645.25" x2="478.75" y1="516.2617" y2="516.2617"/><polygon fill="#A80036" points="488.75,512.2617,478.75,516.2617,488.75,520.2617,484.75,516.2617" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="466.75" x2="466.75" y1="484.2617" y2="504.2617"/><polygon fill="#A80036" points="462.75,494.2617,466.75,504.2617,470.75,494.2617,466.75,498.2617" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="122.75" x2="112.75" y1="277.9492" y2="277.9492"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="112.75" x2="112.75" y1="277.9492" y2="319.9609"/><polygon fill="#A80036" points="108.75,309.9609,112.75,319.9609,116.75,309.9609,112.75,313.9609" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="456.75" x2="466.75" y1="277.9492" y2="277.9492"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="466.75" x2="466.75" y1="277.9492" y2="319.9609"/><polygon fill="#A80036" points="462.75,309.9609,466.75,319.9609,470.75,309.9609,466.75,313.9609" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="112.75" x2="112.75" y1="395.8359" y2="546.2617"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="112.75" x2="277.75" y1="546.2617" y2="546.2617"/><polygon fill="#A80036" points="267.75,542.2617,277.75,546.2617,267.75,550.2617,271.75,546.2617" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="466.75" x2="466.75" y1="528.2617" y2="546.2617"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="466.75" x2="301.75" y1="546.2617" y2="546.2617"/><polygon fill="#A80036" points="311.75,542.2617,301.75,546.2617,311.75,550.2617,307.75,546.2617" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="289.75" x2="289.75" y1="225.9375" y2="245.9375"/><polygon fill="#A80036" points="285.75,235.9375,289.75,245.9375,293.75,235.9375,289.75,239.9375" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="289.75" x2="289.75" y1="558.2617" y2="578.2617"/><polygon fill="#A80036" points="285.75,568.2617,289.75,578.2617,293.75,568.2617,289.75,572.2617" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[ee2983799085d65f96fa6af7dcfc3842]
@startuml
start
if (cpuLoad > frequencyShiftUpperThreshold) then (yes)
: aboveThresholdCounter++
belowThresholdCounter = 0;
else (no)
if (cpuLoad < frequencyShiftLowerThreshold) then (yes)
: belowThresholdCounter++
aboveThresholdCounter = 0;
else (no)
: belowThresholdCounter = 0
aboveThresholdCounter = 0;
endif
endif
if (
aboveThresholdCounter >= maxAboveThresholdCount
or
minFrequencyRequested > currentCpuFrequency
) then (yes)
: IncreaseCpuFrequency()
belowThresholdCounter = 0
aboveThresholdCounter = 0;
else (no)
if (
belowThresholdCounter >= maxBelowThresholdCount
and
currentCpuFreq > minFrequencyRequested
) then (yes)
: DecreaseCpuFrequency()
belowThresholdCounter = 0
aboveThresholdCounter = 0;
endif
endif
stop
@enduml
PlantUML version 1.2019.11(Sun Sep 22 12:02:15 CEST 2019)
(EPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 14.0.2+12-46
Operating System: Linux
Default Encoding: UTF-8
Language: pl
Country: PL
--></g></svg>