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

runq: add prio and runtime #104

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Conversation

richl9
Copy link
Contributor

@richl9 richl9 commented Sep 11, 2024

Dump prio and runtime as well. Removed min_run_time_seconds parameter since we have another lockup helper pending to merge.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 11, 2024
Orabug: 37187104
Signed-off-by: Richard Li <[email protected]>
@richl9 richl9 changed the title add RUNTIME to runq helper runq: add prio and runtime Oct 18, 2024
comm = escape_ascii_string(runqueue.curr.comm.string_())
pid = runqueue.curr.pid.value_()
curr_task_addr = runqueue.curr.value_()
curr_task = runqueue.curr[0]
Copy link
Member

Choose a reason for hiding this comment

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

Why use runqueue.curr[0], runqueue.curr not working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is due to a bug we observed . The pointer object 'runqueue.curr' can change in between when we are getting its attributes, so we need to dereference it first to get the value object for safety.

Copy link
Member

Choose a reason for hiding this comment

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

i see

"""

# _cpu = drgn.helpers.linux.cpumask.for_each_online_cpu(prog)
for cpus in for_each_online_cpu(prog):
runqueue = per_cpu(prog["runqueues"], cpus)
comm = escape_ascii_string(runqueue.curr.comm.string_())
pid = runqueue.curr.pid.value_()
curr_task_addr = runqueue.curr.value_()
Copy link
Member

Choose a reason for hiding this comment

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

This variable is only use when print, can we remove it and just use curr_task.value_()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the same reason, since 'runqueue.curr' could change, we want to get its current address first, followed by de-referencing it via runqueue.curr[0] immediately.

@@ -65,20 +67,31 @@ def _print_cfs_runq(runqueue: Object) -> None:
print(" [no tasks queued]")


def run_queue(prog: Program) -> None:
def run_queue(prog: Program, min_run_time_seconds: int = 0) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

I see you have another lockup helper to down current task in the runqueue which has been run for long time, and it didn't use this helper, then why we need the second parameter min_run_time_seconds here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. Let me remove the parameter since now we have a lockup helper.

Orabug: 37187104
Signed-off-by: Richard Li <[email protected]>
Copy link
Member

@biger410 biger410 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@biger410 biger410 merged commit 8874f60 into oracle-samples:main Nov 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants