LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 08-10-2015, 12:12 PM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Rep: Reputation: Disabled
SCHED_FIFO allowed on one system but not on another


I have code that does the following:
Code:
    struct sched_param p;
    int policy = SCHED_FIFO;

    p.sched_priority = 1;

    if (sched_setscheduler(0, policy, &p) == -1) {
        printf("Unable to set scheduler to SCHED_FIFO, errno=%d\n", errno);
        exit(1);
    }
I can run this code on one CentOS 7 system and the call to sched_setscheduler() completes successfully. The same call when run on another system fails with EPERM (operation not permitted). In both cases the code is run as root, and all of the settings I've checked appear to be the same between the two systems (e.g. /etc/security/limits.conf is identical on both systems, SELinux is disabled on both). Clearly though something is configured differently between the two systems and I cannot figure out what it is.

The manner in which the systems are installed is quite different, one being installed through the normal interactive CentOS 7 install tool and the other being installed by an automated kickstart script. The method of installation of course shouldn't make a difference.

Does anyone have any suggestions what the culprit might be?
 
Old 08-10-2015, 03:30 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Edit: never mind. I was looking at the wrong scheduler.

Last edited by smallpond; 08-10-2015 at 03:41 PM.
 
Old 08-11-2015, 09:50 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Check 'ulimit -e' on each system to see if you are limited on one system.
 
Old 08-11-2015, 11:07 AM   #4
PeterSteele
Member
 
Registered: Jun 2012
Posts: 264

Original Poster
Rep: Reputation: Disabled
Curiously, I discovered that by running

echo $$ >> /sys/fs/cgroup/cpu/tasks

the code above worked as expected. Not exactly sure why the shell's process ID isn't in the tasks list to start with though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
system administrator not allowed to login from this screen in rhel 5 vikilinux Linux - Software 5 03-01-2015 04:00 PM
why does SCHED_FIFO task on one CPU affects other CPU tasks on a multy core system? reg13 Linux - Kernel 2 07-31-2011 09:48 PM
System Hangs, No Connections Allowed salmanucit Linux - Software 1 08-04-2006 07:59 PM
Tracking user logins that was allowed and not allowed eswanepoel Linux - Security 3 08-02-2006 04:37 AM
problem using sched_fifo svsvenu Linux - Newbie 0 07-29-2003 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 11:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration