Skip to content
  • Philippe Gerum's avatar
    cobalt/sched: introduce sched_kick() handler for policy modules · cee27b29
    Philippe Gerum authored
    Scheduling policies may prevent threads from running based on some
    extra state, by not returning them from the sched_pick() handler,
    without reflecting such state with any block bit. Those threads remain
    in the ready state from the scheduler core point of view, although
    they won't be elected for running.
    
    This behavior is typical of policies enforcing a runtime budget for
    instance.
    
    However, we also have to honor the request to move a thread out of
    primary mode (i.e. shadow kicking). Therefore we need a way to tell
    the policy module to release such thread temporarily, until it
    eventually relaxes (e.g. sigwake -> kick -> relax).
    
    To this end, the sched_kick() handler can be defined by policy modules
    for dealing with this specific case. It is called for kicked threads
    bearing the XNREADY bit, once all block bits have been lifted.
    cee27b29