Re: cyclictest: Unable to set scheduling policy / join real-time group or run as root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Feb 2013 08:26:45 +0200
Hartmut Behrens <hartmut.behrens@xxxxxxxxx> wrote:

> On Mon, Feb 25, 2013 at 11:21 PM, Clark Williams <williams@xxxxxxxxxx> 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: signature.asc
Description: PGP signature


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux