-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
lib/ukschedcoop
: Keep track of thread execution times
#965
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @skuenzer only a few minor comments 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nitpicks, feel free to disregard them. By the way, I believe you forgot to write the commit message for the last commit of this PR (lib/ukschedcoop: Implement interface for returning idle thread
).
`__nsec` and `__snsec` are defined as 64-bit integers based on `__u64` and `__s64`. Depending on the target architecture, these data types are based on either `long` or `long long`. The time conversion macros, such as `ukarch_time_nsec_to_sec()`, did not strictly adhere to the data type definition, as some basic constants were defined as `UL`, while others were defined as `ULL`, resulting in promotion to `long long` when the architecture used `long` for 64-bit values. Although `long long` is effectively treated as a 64-bit integer by `gcc`, the compiler still issues a warning for mismatched integer types when the print format definitions `__PRInsec` and `__PRIsnec` are used and a promotion had occurred. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
This commit extends `struct uk_thread` with a field for keeping track of the execution time of a thread. Checkpatch-Ignore: SPLIT_STRING Signed-off-by: Simon Kuenzer <simon@unikraft.io>
This commit introduces an implementation for tracking thread execution time with minimal execution overhead. On every scheduler call (`uk_sched_yield()`), the execution time of the current thread is updated. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
I did not really forget 😇 but I added something now. |
With the intention for accessing metrics (like thread execution time), this commit introduces an interface to return a reference to the idle thread. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
This commit implements the callback for `uk_sched_idle_thread()` for `lib/ukschedcoop`. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
77c1553
to
38b3c61
Compare
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks.
Reviewed-by: Michalis Pappas michalis@unikraft.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Sergiu Moga sergiu@unikraft.io
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
This commit extends `struct uk_thread` with a field for keeping track of the execution time of a thread. Checkpatch-Ignore: SPLIT_STRING Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Sergiu Moga <sergiu@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #965
This commit introduces an implementation for tracking thread execution time with minimal execution overhead. On every scheduler call (`uk_sched_yield()`), the execution time of the current thread is updated. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Sergiu Moga <sergiu@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #965
With the intention for accessing metrics (like thread execution time), this commit introduces an interface to return a reference to the idle thread. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Sergiu Moga <sergiu@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #965
This commit implements the callback for `uk_sched_idle_thread()` for `lib/ukschedcoop`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Michalis Pappas <michalis@unikraft.io> Reviewed-by: Sergiu Moga <sergiu@unikraft.io> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #965
This broke the build on
See: https://github.com/unikraft/unikraft/actions/runs/5808848506/job/15746476437#step:5:3954 |
It's not related to this pr. Since this commit was merged in |
You're right, i just saw this now. |
Base target
Additional configuration
CONFIG_LIBUKSCHED=y
CONFIG_LIBUKSCHEDCOOP=y
Description of changes
This PR introduces keeping track of thread execution times with
lib/schedcoop
and is implemented with minimal overhead. An interface for returning theidle
thread enables CPU utilization computations by putting thread execution times in relation over a time window.