Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

scx: Fix hotplug #217

Merged
merged 3 commits into from
Jun 6, 2024
Merged

scx: Fix hotplug #217

merged 3 commits into from
Jun 6, 2024

Commits on Jun 6, 2024

  1. scx: Remove enum rq_onoff_reason enum

    The existing hotplug code is a bit brittle in that the sched_class->{online,
    offline} callbacks can be invoked both from hotplug context, or from domain
    rebuild context. A callback is only invoked in one of the two contexts, with
    the context that runs the callback setting rq->online accordingly to avoid
    doing the callback more times than necessary. Unfortuntaly, this causes commit
    2125c00 ("cgroup/cpuset: Make cpuset hotplug processing synchronous") to
    break hotplug for us because it makes the topology rq->online event happen
    before the cpu hotplug rq->online event; thus preventing us from invoking the
    cpu online callback in the scheduler.
    
    This integration is fragile and hacky, so we'll instead call directly into
    ext.c on the hotplug path. This will be added in a subsequent commit.
    
    Signed-off-by: David Vernet <[email protected]>
    Byte-Lab committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    24db48d View commit details
    Browse the repository at this point in the history
  2. scx: Call directly into ext.c for hotplug events

    The rq_online() and rq_offline() sched_class callbacks may be invoked on either
    the domain creation path, or on the hotplug path. ext.c would previously only
    invoke its hotplug logic when those callbacks are invoked on the hotplug path.
    This turned out to be a bit brittle, as hotplug could break for sched_ext if we
    first invoked rq_online() from the domain path, as it would cause us to skip
    invoking it on the hotplug path due to hotplug implementation details.
    
    To avoid this frailty (and fix a hotplug regression for us after merging
    v6.10), let's instead just call directly into ext.c on the hotplug path. In
    doing so, we can also move the ops.cpu_online() and ops.cpu_offline() callbacks
    outside of the rq lock region, thus making them sleepable. A test for this will
    be added in a subsequent patch.
    
    Signed-off-by: David Vernet <[email protected]>
    Byte-Lab committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    a5a1608 View commit details
    Browse the repository at this point in the history
  3. scx: Validate that cpu callbacks can be sleepable

    Now that ops.cpu_online() and ops.cpu_offline() can be sleepable,
    let's update their test BPF progs to be sleepable to validate.
    
    Signed-off-by: David Vernet <[email protected]>
    Byte-Lab committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    36773d9 View commit details
    Browse the repository at this point in the history