Skip to content

pelt scheduler: add new tests to validate pelt - #447

Open
vnarapar wants to merge 1 commit into
qualcomm-linux:mainfrom
vnarapar:pelt_scheduler
Open

pelt scheduler: add new tests to validate pelt#447
vnarapar wants to merge 1 commit into
qualcomm-linux:mainfrom
vnarapar:pelt_scheduler

Conversation

@vnarapar

@vnarapar vnarapar commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds new testcases to validate PELT scheduler

  • This validates configs, decay, load tracking, schedutil and different tunables

@smuppand

Copy link
Copy Markdown
Contributor

vnarapar please fix the workflow issues

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since there are multiple files in the PR, I am providing a consolidated review.

  1. CI is failing for executable permissions and Shell Lint.
  2. All run.sh files use [ -z "$__INIT_ENV_LOADED" ]; please switch to ${__INIT_ENV_LOADED:-}.
  3. All run.sh files call check_dependencies but do not check the return value.
  4. PELT_decay Method 1 reads /proc/self/sched through grep, so it reads the grep process sched data instead of the shell workload. Please read /proc/$$/sched instead.
  5. PELT_sched_debug checks only whether /sys/kernel/debug exists, not whether debugfs is mounted. Please validate debugfs via /proc/mounts.
  6. PELT_schedutil uses -ge for “frequency increased”, making the equal-frequency warning path unreachable. Use -gt for increase and handle equality separately.
  7. Several scripts write .res and then exit 1. Please exit 0 after writing test FAIL/SKIP results so LAVA can publish the result cleanly.
  8. PELT_config still has copy-paste “DMA-BUF” log messages.
  9. Some tunables/sysfs entries are kernel-version/config dependent and should not be hard failures unless explicitly documented.
  10. YAMLs currently mask cd/run/send-to-lava failures with || true. Please remove unnecessary masking once run.sh result handling is fixed.

After these fixes and runtime evidence on at least one target, this can be reviewed again.

@vnarapar
vnarapar force-pushed the pelt_scheduler branch 2 times, most recently from ae76072 to 1d30a61 Compare May 12, 2026 09:09
@vnarapar

Copy link
Copy Markdown
Contributor Author

Hi Srikanth Muppandam (@smuppand) , thanks fixed the issues. Have a query wrt Iusse#2. I see that most scripts are using [ -z "$__INIT_ENV_LOADED" ];, any reason to move to ${__INIT_ENV_LOADED:-}.
Will share the runtime status once done.

@smuppand

Copy link
Copy Markdown
Contributor

Hi Srikanth Muppandam (@smuppand) , thanks fixed the issues. Have a query wrt Iusse#2. I see that most scripts are using [ -z "$__INIT_ENV_LOADED" ];, any reason to move to ${__INIT_ENV_LOADED:-}. Will share the runtime status once done.

because ${var:-} is safe when the variable is unset.

In the current script, the code directly expands "$__INIT_ENV_LOADED" before sourcing init_env.

Why it matters

In normal /bin/sh without set -u, both may work.

But if the script is run by a stricter wrapper, CI harness, or future common runner with:

set -u

then this line can fail:

"$__INIT_ENV_LOADED"

because the variable may not exist yet.

You can get an error like:

__INIT_ENV_LOADED: parameter not set

Using this form avoids that:

"${__INIT_ENV_LOADED:-}"

It means:

Use $__INIT_ENV_LOADED if it is set; otherwise use empty string.

So the test becomes safe even when the variable is unset.

Why we use it in repo scripts

This pattern is already safer and more portable:

if [ -z "${__INIT_ENV_LOADED:-}" ]; then
. "$INIT_ENV"
fi

It avoids:

Comment thread Runner/suites/Kernel/Scheduler/PELT_config/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_config/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_config/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_sched_debug/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_sched_debug/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_tunables/run.sh
@smuppand

Copy link
Copy Markdown
Contributor

vnarapar, please rebase and apply the small fixes mentioned above.

Comment thread Runner/suites/Kernel/Scheduler/PELT_config/run.sh
Comment thread Runner/suites/Kernel/Scheduler/PELT_sched_debug/run.sh Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_sched_debug/README.md Outdated
Comment thread Runner/suites/Kernel/Scheduler/PELT_config/run.sh
Comment thread Runner/suites/Kernel/Scheduler/PELT_config/PELT_config.yaml Outdated
This PR adds new testcases to validate PELT scheduler
- This validates configs, decay, load tracking, schedutil and different
  tunables

Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
@github-actions

Copy link
Copy Markdown

@ualcomm/qualcomm-linux-testing.triage This pull request has been marked as stale due to 30 days of inactivity and will automatically close after an additional 5 days.

@github-actions github-actions Bot added the Stale label Jul 12, 2026
@github-actions github-actions Bot closed this Jul 18, 2026
@vnarapar vnarapar reopened this Jul 20, 2026
@github-actions github-actions Bot removed the Stale label Jul 21, 2026
@github-actions

Copy link
Copy Markdown

@ualcomm/qualcomm-linux-testing.triage This pull request has been marked as stale due to 30 days of inactivity and will automatically close after an additional 5 days.

@github-actions github-actions Bot added the Stale label Aug 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All seven suites duplicate bootstrap, manual .res writes, and pass flags instead of using the repository bootstrap and test_result_init, test_result_record, and test_result_finish.

Result and cleanup behavior diverges across the seven suites, and future framework fixes will not propagate.

Convert every suite to the current repository bootstrap and shared result API. Put reusable PELT probing in a shared helper rather than repeating it across launchers.

# ---------------------------------------------------------------------------
# Prerequisite: /proc/schedstat must be present
# ---------------------------------------------------------------------------
if [ ! -f /proc/schedstat ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/proc/schedstat is not PELT evidence

Rename and scope this as a schedstat activity test, or validate a PELT-specific signal such as se.avg.util_avg for the workload task when the required debug capability is available.

log_info " Total run_delay : ${total_delay} ns"
log_info " Total pcount : ${total_pcount}"

if [ "$total_runtime" -gt 0 ] 2>/dev/null; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

false PELT pass criterion. Keep this as an informational schedstat check, or move it to a scheduler-statistics suite. Do not make it the functional pass criterion for PELT.

if ! grep -qE "debugfs /sys/kernel/debug" /proc/mounts 2>/dev/null; then
if [ "$(id -u 2>/dev/null)" = "0" ]; then
log_info "debugfs not mounted - attempting to mount..."
if mount -t debugfs debugfs /sys/kernel/debug 2>/dev/null; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test-mounted debugfs is never restored. Record whether the test mounted debugfs and unmount it in an EXIT, INT, and TERM cleanup handler only when the test mounted it.

run:
steps:
- REPO_PATH=$PWD
- cd "$REPO_PATH/Runner/suites/Kernel/Scheduler/PELT_schedstat" || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

masked directory failure. cd ... || true suppresses failure to enter the suite directory.

Remove || true and use the standard separate repo-path, cd, invocation, and result-upload steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants