Skip to content

sched: add 16-HWT check_sanity for V81, fix MAX_HTHREADS table#36

Open
zbelinsk wants to merge 3 commits into
masterfrom
extending_16hwt_dosched
Open

sched: add 16-HWT check_sanity for V81, fix MAX_HTHREADS table#36
zbelinsk wants to merge 3 commits into
masterfrom
extending_16hwt_dosched

Conversation

@zbelinsk
Copy link
Copy Markdown
Contributor

On V81 hardware (up to 16 HW threads), check_sanity.v81opt.S was a symlink to v73opt.S,
which only scanned runlist_prios[0..7] (8 threads). Threads 8–15 were invisible to the
scheduler — silently never preempted or rescheduled.

This PR fixes that root cause and cleans up the surrounding infrastructure:

  • New check_sanity.v81opt.S: real 4-batch vrmaxh implementation covering all 16 HW threads
  • MAX_HTHREADS table corrected: V68/V73=8, V81+=16 (previously V60+=16, which was wrong and hid the missing implementation)
  • hthreads_mask &= (1U << MAX_HTHREADS) - 1 replaces three hardcoded 0xffff in setup.ref.c and hwconfig.ref.c
  • v68opt.S promoted from symlink to real file
  • hardcoded byte offsets replaced with named macros across v4/v68/v81
  • Register map comments corrected (were copy-pasted and entirely wrong)
  • testlist.v81 → symlink to testlist.v73; futex/pi test now passes as the scheduler correctly finds all ready threads

zbelinsk added 3 commits May 27, 2026 14:10
v81opt.S was a symlink to v73opt.S, which only ran vrmaxh over 2
batches (runlist_prios[0..7], 8 threads max).  On V81 hardware with
up to 16 HW threads the scheduler was silently ignoring threads 8-15
when picking the next thread to run.

Fix by:
- Adding a real check_sanity.v81opt.S with 4-batch vrmaxh covering
  runlist_prios[0..15].
- Correcting MAX_HTHREADS: V68/V73=8, V81+=16 (was V60+=16, which
  was wrong for V68/V73 and masked the missing v81 implementation).
- Replacing the hardcoded 0xffff hthreads_mask ANDs in
  setup.ref.c and hwconfig.ref.c with (1U << MAX_HTHREADS) - 1.
- Updating register map comments in v4opt.S, v68opt.S, v81opt.S to
  reflect actual register usage (old comments were incorrect).
- replacing hardcoded offsets for check_sanity.v4opt.S, check_sanity.v68opt.S, check_sanity.v81opt.S.
- v68opt.S promoted from symlink to real file (owns the 8-HWT path).
- testlist.v81 symlinked to testlist.v73; futex/pi test now passes
  since the scheduler correctly finds ready threads.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
Resolve type-change conflict on scripts/testlist.v81: keep this branch's
symlink to testlist.v73. master's edit (enabling time/timer/test_standalone)
is preserved because the v81->v73->...->v61 chain already includes it.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
…ched

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
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.

1 participant