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 10:09:57 -0600 [thread overview]
Message-ID: <20130227100957.22994960@riff.lan> (raw)
In-Reply-To: <CA+69FtDP0K5AqmL+Hi4vouuoOdHN2md4DrUkkZ1rtZFZAzfcJw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]
On Wed, 27 Feb 2013 08:26:45 +0200
Hartmut Behrens <hartmut.behrens@gmail.com> wrote:
> On Mon, Feb 25, 2013 at 11:21 PM, Clark Williams <williams@redhat.com> wrote:
> > Changing your scheduling policy requires extra privileges. You can
> > either run cyclictest as root, or if your distribution uses PAM, you
> > can set up a file in /etc/security/limits.d which enable group access to
> > changing scheduler policy. You can name the file whatever you want, I
> > usually call mine 99-realtime.conf:
> >
> > # cat <<EOF >/etc/security/limits.d/99-realtime.conf
> > @realtime - rtprio 99
> > @realtime - memlock unlimited
> > EOF
> >
> > Then create a group named realtime and add your username to the newly
> > created group:
> >
> > # groupadd realtime
> > # usermod -a -G realtime yourUserID
> >
> > Log out, then log back in and you should be able to verift that you're
> > in the realtime group using the 'groups' command. Once you're username
> > is a member of the realtime group, you should be able to run cyclictest
> > without being root.
>
> This problem persists even when I run cyclictest as root. I have also
> set up PAM as described above and added root to the realtime group
> without any success.
> I have also tried "sudo ./cyclictest" and " su -c './cyclictest'
>
> Is this perhaps a more fundamental problem?
>
> Just to recap: I applied the patch-3.2-rt10 patch cleanly to a v3.2
> kernel customized for a TI OMAP (ARM) processor. CONFIG_PREEMPT_RT was
> enabled and CPU frequency scaling disabled.
>
This shouldn't have anything to do with the PREEMPT_RT patchset.
Changing scheduling policy via the sched_setscheduler(2) syscall is a
fundamental component of the Linux scheduler.
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);
}
Clark
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2013-02-27 16:10 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 [this message]
2013-02-27 16:22 ` Hartmut Behrens
2013-02-27 16:25 ` Hartmut Behrens
2013-02-27 20:00 ` Clark Williams
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=20130227100957.22994960@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