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

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2022-03-31 16:26:59 +02:00
parent d91ed6fa80
commit 87c5007970
2 changed files with 12 additions and 4 deletions
+4 -3
View File
@@ -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);
+8 -1
View File
@@ -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));