~aleteoryx/muditaos

muditaos/module-sys/SystemManager/doc/data/CpuFreqChangeAlgorithm.puml -rw-r--r-- 844 bytes
a405cad6Aleteoryx trim readme 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@startuml
skinparam BackgroundColor F0F0F0
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