Hi All,
I was trying to change set the new scheduling policy on centos7, Getting EPERM Operation not permitted error.
Please find the below scenario:
This is my python code which is trying to change the priority and setting the new scheduling policy from SCHED_OTHER TO SCHED_RR
On my VM when I'm running this script as a sudo it's working fine, it is able to change the policy.
But when I'm running this script from my centos7.8 Desktop while sched_setscheduler() calling this function getting EPERM error operation not permitted, I'm doing this also as a sudo user.
I got the resolution like when i changed the /proc/sys/kernel/sched_rt_runtime_us from 950000 to -1 its working fine, on VM /proc/sys/kernel/sched_rt_runtime_us=950000 and its working fine.
Can anyone help me here.
---------------------------------
#!/usr/bin/env python2.7
import ctypes
import os
SCHED_OTHER = ctypes.c_int(0)
SCHED_FIFO = ctypes.c_int(1)
SCHED_RR = ctypes.c_int(2)
libc = ctypes.CDLL("libc.so.6")
print("Before my scheduler=%d" % libc.sched_getscheduler(os.getpid()))
param = ctypes.c_int(60)
print (os.getpid())
err = libc.sched_setscheduler(os.getpid(), SCHED_RR, ctypes.byref(param))
#err = libc.sched_setscheduler(os.getpid(), SCHED_RR, 0)
print (err)
if err != 0:
print("errno=%d" % ctypes.get_errno())
print("After my scheduler=%d" % (libc.sched_getscheduler(os.getpid())))
-----------------------------------------------------------------------------------------
EPERM operation not permitted while changing scheduling policy
General support questions
Return to “CentOS 7 - General Support”
Jump to
- CentOS General Purpose
- ↳ CentOS - FAQ & Readme First
- ↳ Announcements
- ↳ CentOS Social
- ↳ User Comments
- ↳ Website Problems
- CentOS 8
- ↳ CentOS 8 - General Support
- ↳ CentOS 8 - Hardware Support
- ↳ CentOS 8 - Networking Support
- ↳ CentOS 8 - Security Support
- CentOS 7
- ↳ CentOS 7 - General Support
- ↳ CentOS 7 - Software Support
- ↳ CentOS 7 - Hardware Support
- ↳ CentOS 7 - Networking Support
- ↳ CentOS 7 - Security Support
- CentOS 6
- ↳ CentOS 6 - General Support
- ↳ CentOS 6 - Software Support
- ↳ CentOS 6 - Hardware Support
- ↳ CentOS 6 - Networking Support
- ↳ CentOS 6 - Security Support
- CentOS Legacy Versions
- ↳ CentOS 4
- ↳ CentOS 4 - General Support
- ↳ CentOS 4 - Software Support
- ↳ CentOS 4 - Hardware Support
- ↳ CentOS 4 - Networking Support
- ↳ CentOS 4 - Server Support
- ↳ CentOS 4 - Security Support
- ↳ CentOS 4 - Webhosting Support
- ↳ CentOS 4 - X86_64,s390(x) and PowerPC Support
- ↳ CentOS 4 - Oracle Installation and Support
- ↳ CentOS 4 - Miscellaneous Questions
- ↳ CentOS 5
- ↳ CentOS 5 - General Support
- ↳ CentOS 5 - Software Support
- ↳ CentOS 5 - Hardware Support
- ↳ CentOS 5 - Networking Support
- ↳ CentOS 5 - Server Support
- ↳ CentOS 5 - Security Support
- ↳ CentOS 5 - Webhosting Support
- ↳ CentOS 5 - X86_64,s390(x) and PowerPC Support
- ↳ CentOS 5 - Oracle Installation and Support
- ↳ CentOS 5 - Miscellaneous Questions