public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Clark Williams <williams@redhat.com>
To: Hartmut Behrens <hartmut.behrens@gmail.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: cyclictest: Unable to set scheduling policy / join real-time group or run as root
Date: Wed, 27 Feb 2013 14:00:13 -0600	[thread overview]
Message-ID: <20130227140013.0f28c91b@riff.lan> (raw)
In-Reply-To: <CA+69FtB+_vt+L8VcsLs31DudkYE0iz7ckL=obQGkBP=f7smvSQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On Wed, 27 Feb 2013 18:22:20 +0200
Hartmut Behrens <hartmut.behrens@gmail.com> wrote:

> On Wed, Feb 27, 2013 at 6:09 PM, Clark Williams <williams@redhat.com> wrote:
> > What happens if you compile and run this program on your kernel?
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <sched.h>
> > #include <errno.h>
> > #include <memory.h>
> >
> > int main(int argc, char **argv)
> > {
> >         int ret;
> >         struct sched_param s;
> >
> >         memset(&s, 0, sizeof(s));
> >         s.sched_priority = 1;
> >         if ((sched_setscheduler(0, SCHED_FIFO, &s))) {
> >                 fprintf(stderr, "error changing policy: %s\n", strerror(errno));
> >                 exit(errno);
> >         }
> >         printf("successfully changed policy to SCHED_FIFO priority 1\n");
> >         exit(0);
> > }
> 
> When I run it as root I get "error changing policy: Operation not permitted".
> 
> Does this mean that some hard limits are not correctly set for root?

Well this is a new one on me. Some questions:

Do you have SELinux running?

Are there any files in /etc/security/limits.d other than the one you put
there?

Other than that I can't think of a reason why sched_setscheduler()
would fail as root. 

Clark

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2013-02-27 20:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 20:03 cyclictest: Unable to set scheduling policy / join real-time group or run as root Hartmut Behrens
2013-02-25 20:55 ` Sven-Thorsten Dietrich
2013-02-25 21:24   ` Hartmut Behrens
2013-02-25 21:35     ` Diego Simak
2013-02-26  8:10     ` Uwe Kleine-König
2013-02-25 21:21 ` Clark Williams
2013-02-27  6:26   ` Hartmut Behrens
2013-02-27 16:09     ` Clark Williams
2013-02-27 16:22       ` Hartmut Behrens
2013-02-27 16:25         ` Hartmut Behrens
2013-02-27 20:00         ` Clark Williams [this message]
2013-02-28 15:07           ` Hartmut Behrens
2013-02-28 15:27             ` Clark Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130227140013.0f28c91b@riff.lan \
    --to=williams@redhat.com \
    --cc=hartmut.behrens@gmail.com \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox