Skip to content

sched refactor part2#266

Merged
hexagonal-sun merged 2 commits intomasterfrom
sched-refactor-part2
Mar 19, 2026
Merged

sched refactor part2#266
hexagonal-sun merged 2 commits intomasterfrom
sched-refactor-part2

Conversation

@hexagonal-sun
Copy link
Owner

  • sched: Work: deref into Arc rather than OwnedTask
    Since a Arc can be obtained from TASK_LIST, this would allow the
    potential mutation of 'owned'-state from other CPUs thereby causing a
    race condition. Thefore, ensure that the deref of an Arc<Work> only
    permits access to t_shared.

  • sched: eliminate CUR_TASK_PTR
    Replace CUR_TASK_PTR with ProcessCtx. This allows differentiation
    between functions that access process context (take in ProcessCtx as a
    parameter) and those that don't.

    When creating a new class of scheduleable tasks (softirqs, kthreads),
    this ensure that those functions cannot call context-sensitive
    functions.

Since a Arc<Work> can be obtained from `TASK_LIST`, this would allow the
potential mutation of 'owned'-state from other CPUs thereby causing a
race condition. Thefore, ensure that the deref of an `Arc<Work>` only
permits access to `t_shared`.
Copy link
Collaborator

@arihant2math arihant2math left a comment

Choose a reason for hiding this comment

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

LGTM

Replace `CUR_TASK_PTR` with `ProcessCtx`. This allows differentiation
between functions that access process context (take in `ProcessCtx` as a
parameter) and those that don't.

When creating a new class of scheduleable tasks (softirqs, kthreads),
this ensure that those functions cannot call context-sensitive
functions.
@hexagonal-sun hexagonal-sun merged commit bd64a67 into master Mar 19, 2026
4 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