Commit 87c50079 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(container): when running in fedora-generic-kerner container, no setting of priority

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent d91ed6fa
......@@ -234,9 +234,10 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
if (system("grep -iq 'ID_LIKE.*fedora' /etc/os-release && uname -a | grep -c rt")==0)
if (system("cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods'")==0)
settingPriority = 0;
if (checkIfFedoraDistribution())
if (checkIfGenericKernelOnFedora())
if (checkIfInsideContainer())
settingPriority = 0;
if (settingPriority) {
ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
......
......@@ -396,7 +396,14 @@ void *rrc_enb_process_msg(void *notUsed) {
int main( int argc, char **argv ) {
set_priority(79);
int set_exe_prio = 1;
if (checkIfFedoraDistribution())
if (checkIfGenericKernelOnFedora())
if (checkIfInsideContainer())
set_exe_prio = 0;
if (set_exe_prio)
set_priority(79);
if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1)
{
fprintf(stderr, "mlockall: %s\n", strerror(errno));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment