Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixups to scheduler/priority settings #4459

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Commits on Oct 23, 2024

  1. libct: simplify setIOPriority/setupScheduler calls

    Move the nil check inside, simplifying the callers.
    
    Fixes: bfbd030 ("Add I/O priority")
    Fixes: 770728e ("Support `process.scheduler`")
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    d1cf5f2 View commit details
    Browse the repository at this point in the history
  2. utils: simplify newProcess

    This code is not in libcontainer, meaning it is only used by a short lived
    binary (runc start/run/exec). Unlike code in libcontainer (see
    CreateLibcontainerConfig), here we don't have to care about copying the
    structures supplied as input, meaning we can just reuse the pointers
    directly.
    
    Fixes: bfbd030 ("Add I/O priority")
    Fixes: 770728e ("Support `process.scheduler`")
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    35da01b View commit details
    Browse the repository at this point in the history
  3. libct: unify IOPriority setting

    For some reason, io priority is set in different places between runc
    start/run and runc exec:
    
     - for runc start/run, it is done in the middle of (*linuxStandardInit).Init,
       close to the place where we exec runc init.
     - for runc exec, it is done much earlier, in (*setnsProcess) start().
    
    Let's move setIOPriority call for runc exec to (*linuxSetnsInit).Init,
    so it is in the same logical place as for runc start/run.
    
    Also, move the function itself to init_linux.go as it's part of init.
    
    Should not have any visible effect, except part of runc init is run with
    a different I/O priority.
    
    Fixes: bfbd030 ("Add I/O priority")
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    fd525fd View commit details
    Browse the repository at this point in the history
  4. libct/configs: rm IOPrioClassMapping

    This is an internal implementation detail and should not be either
    public or visible.
    
    Amend setIOPriority to do own class conversion.
    
    Fixes: bfbd030 ("Add I/O priority")
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    c655afb View commit details
    Browse the repository at this point in the history
  5. libct/configs/validate: add IOPriority.Class validation

    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Oct 23, 2024
    Configuration menu
    Copy the full SHA
    0a65a4d View commit details
    Browse the repository at this point in the history