Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scx_layered: Add per layer time slices to stats #732

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

minosfuture
Copy link
Contributor

Basically addressing issue #720, described from @hodgesds:

In scx_layered the time slice can be [configured per layer](https://github.com/sched ext/scx/blob/main/scheds/rust/scx_layered/src/main.rs#L493). This should be added to the LayerStats for each layer. During stats refresh read the time slice duration (from the bpf skel) to the layer and add it to the stats. Finally, update the format method for LayerStats to print the per layer time slices.

Quoting issue sched-ext#720 description from @hodgesds:

> In `scx_layered` the time slice can be [configured per layer](https://github.com/sched-ext/scx/blob/main/scheds/rust/scx_layered/src/main.rs#L493).
> This should be added to the
> [`LayerStats`](https://github.com/sched-ext/scx/blob/main/scheds/rust/scx_layered/src/stats.rs#L51)
> for each layer. During stats
> [refresh](https://github.com/sched-ext/scx/blob/main/scheds/rust/scx_layered/src/main.rs#L852)
> read the time slice duration (from the bpf skel) to the layer and add it
> to the stats. Finally, update the
> [format](https://github.com/sched-ext/scx/blob/main/scheds/rust/scx_layered/src/stats.rs#L218)
> method for `LayerStats` to print the per layer time slices.

Signed-off-by: Ming Yang <[email protected]>
@minosfuture
Copy link
Contributor Author

example monitoring result:

preempt/first/xllc/xnuma/idle/fail= 0.00/ 0.00/ 0.00/ 0.00/ 0.00/ 0.00 min_exec=87.24/ 27.99ms, slice=20ms

###### Thu, 3 Oct 2024 20:39:32 -0700 ######                                                 
tot=    196 local=87.24 open_idle=21.94 affn_viol= 0.00 proc=7ms                                                                                                                          
busy=  1.3 util=    7.4 load=      4.3 fallback_cpu=  2                                      
excl_coll=0.00 excl_preempt=0.00 excl_idle=0.00 excl_wakeup=0.00           
  batch    : util/frac=    0.0/  0.0 load/frac=      0.0/  0.0 tasks=    13
             tot=      0 local= 0.00 wake/exp/reenq= 0.00/ 0.00/ 0.00 
             xlayer_wake= 0.00 xlayer_rewake= 0.00                            
             keep/max/busy= 0.00/ 0.00/ 0.00 kick= 0.00 yield/ign= 0.00/    0        
             open_idle= 0.00 mig= 0.00 xnuma_mig= 0.00 xllc_mig= 0.00 affn_viol= 0.00                                                                                                     
             preempt/first/xllc/xnuma/idle/fail= 0.00/ 0.00/ 0.00/ 0.00/ 0.00/ 0.00 min_exec= 0.00/   0.00ms, slice=20ms                                                                   
             cpus=  1 [  1,  1] 00000001                                                     
  immediate: util/frac=    0.0/  0.0 load/frac=      0.0/  0.0 tasks=     0                  
             tot=      0 local= 0.00 wake/exp/reenq= 0.00/ 0.00/ 0.00  
             xlayer_wake= 0.00 xlayer_rewake= 0.00                                           
             keep/max/busy= 0.00/ 0.00/ 0.00 kick= 0.00 yield/ign= 0.00/    0 
             open_idle= 0.00 mig= 0.00 xnuma_mig= 0.00 xllc_mig= 0.00 affn_viol= 0.00
             preempt/first/xllc/xnuma/idle/fail= 0.00/ 0.00/ 0.00/ 0.00/ 0.00/ 0.00 min_exec= 0.00/   0.00ms, slice=20ms                                                                  
             cpus=  2 [  2,  2] 0000000c                                                     
             excl_coll= 0.00 excl_preempt= 0.00
  normal   : util/frac=    7.4/100.0 load/frac=      4.3/100.0 tasks=    49                                                                                                               
             tot=    196 local=87.24 wake/exp/reenq=12.24/ 0.51/ 0.00
             xlayer_wake= 0.00 xlayer_rewake= 0.00                                                                                                                                        
             keep/max/busy= 0.51/ 0.00/ 0.00 kick= 0.51 yield/ign= 5.61/    0 
             open_idle=21.94 mig=23.98 xnuma_mig= 0.00 xllc_mig= 0.00 affn_viol= 0.00                                                                                                     
             preempt/first/xllc/xnuma/idle/fail= 0.00/ 0.00/ 0.00/ 0.00/ 0.00/ 0.00 min_exec=87.24/  27.99ms, slice=20ms                                                                   
             cpus=  1 [  1,  1] 00000002

Copy link
Contributor

@hodgesds hodgesds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hodgesds hodgesds added this pull request to the merge queue Oct 4, 2024
Merged via the queue into sched-ext:main with commit 8f0485b Oct 4, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants