Skip to content

sched_setattr: Function not implemented #53

Closed

Description

@Ox24

Hey there,
wanted to test some realtime scheduling and tried to measure some timings and overhead caused by gvisor.

Using the debug flag on gvisor, i noticed that i get:

write(0x4, 0x7facec000af0 "sched_setattr: Function not implemented\n", 0x28)

therefore i cannot run and test my application. Any advices?

docker command : docker run --runtime=runsc --cap-add SYS_NICE -i -d -t simple-interpolation
docker version: Docker version 18.03.1-ce
uname -a : 4.9.84-rt62 SMP PREEMPT RT Tue May 8 18:11:18 CEST 2018 x86_64 x86_64 x86_64 GNU/Linux

Activity

  1. fvoznika commented on May 16, 2018

    @fvoznika
    Member

    gVisor doesn't implement sched_setattr. gVisor uses the Go runtime for scheduling, it doesn't support realtime scheduling nor priorities.

    Your options are to change the application to not make sched_setattr(2) calls or to ignore errors from it.

  2. Ox24 commented on May 17, 2018

    @Ox24
    Author

    sadly that is not an option for me. We are running different rt applications on our system using docker and wanted to isolate some of them. Therefore i thougt, i could measure the impact of gvisor on rt applications. Do you guys have a in-depth descritption on how gvisor works?

  3. fvoznika commented on May 18, 2018

    @fvoznika
    Member

    You can try to stub out the required syscalls and pretend they succeeded to see how far you can get. [1] has a patch making sched_setattr a noop as an example.

    We're improving the documentation as we find time. You can find more information about scheduling in gvisor/pkg/sentry/kernel/README.md

    [1]

    diff --git a/pkg/sentry/syscalls/linux/linux64.go b/pkg/sentry/syscalls/linux/linux64.go
    index edfcdca..e06253a 100644
    --- a/pkg/sentry/syscalls/linux/linux64.go
    +++ b/pkg/sentry/syscalls/linux/linux64.go
    @@ -186,7 +186,7 @@ var AMD64 = &kernel.SyscallTable{
                    //     139: Sysfs, TODO
                    140: Getpriority,
                    141: Setpriority,
    -               142: syscalls.CapError(linux.CAP_SYS_NICE), // SchedSetparam, requires cap_sys_nice
    +               142: syscalls.Noop(),
                    143: SchedGetparam,
                    144: SchedSetscheduler,
                    145: SchedGetscheduler,
    diff --git a/pkg/sentry/syscalls/syscalls.go b/pkg/sentry/syscalls/syscalls.go
    index 1176f85..9f1f25e 100644
    --- a/pkg/sentry/syscalls/syscalls.go
    +++ b/pkg/sentry/syscalls/syscalls.go
    @@ -33,6 +33,12 @@ import (
            "gvisor.googlesource.com/gvisor/pkg/syserror"
     )
     
    +func Noop() kernel.SyscallFn {
    +       return func(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) {
    +               return 0, nil, nil
    +       }
    +}
    +
     // Error returns a syscall handler that will always give the passed error.
     func Error(err error) kernel.SyscallFn {
            return func(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) {
    
  4. ianlewis commented on Jun 6, 2018

    @ianlewis
    Contributor

    I suggest changing the bug title to "sched_setattr: Function not implemented"

  5. changed the title [-]Function not implemented[/-] [+]sched_setattr: Function not implemented[/+] on Jun 8, 2018
  6. fvoznika commented on Jan 11, 2019

    @fvoznika
    Member

    Closing as this is something unlikely to be supported.

  7. added
    status: wontfix
    area: compatibility
    on Jan 17, 2019
  8. ianlewis commented on Jan 17, 2019

    @ianlewis
    Contributor

    Just for completeness, the reason why it's not likely to be supported is because we need Go runtime support for scheduling.

  9. added a commit that references this issue on May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compatibilitystatus: wontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions