mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-01 11:02:53 +00:00
pull this code echo -1 > /proc/sys/kernel/sched_rt_runtime_us yourself if you want to enable this
This commit is contained in:
parent
7afd4cae67
commit
3d57cbda98
@ -731,9 +731,6 @@ SWITCH_DECLARE(int32_t) set_realtime_priority(void)
|
||||
* Try to use a round-robin scheduler
|
||||
* with a fallback if that does not work
|
||||
*/
|
||||
int fd;
|
||||
const char *rt = "/proc/sys/kernel/sched_rt_runtime_us";
|
||||
char data[] = "-1\n";
|
||||
struct sched_param sched = { 0 };
|
||||
sched.sched_priority = SWITCH_PRI_LOW;
|
||||
if (sched_setscheduler(0, SCHED_FIFO, &sched)) {
|
||||
@ -742,21 +739,6 @@ SWITCH_DECLARE(int32_t) set_realtime_priority(void)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((fd = open(rt, O_WRONLY)) > 0) {
|
||||
int r;
|
||||
|
||||
if (!(r = write(fd, data, sizeof(data)))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Disablling RT limits [%s][%d]\n", rt, r);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Disabling RT throttling.\n");
|
||||
}
|
||||
close(fd);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error opening %s\n", rt);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user