Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
6e5d7cdd
Commit
6e5d7cdd
authored
9 years ago
by
Rohit Gupta
Browse files
Options
Downloads
Patches
Plain Diff
disable CPU affinity for UE and also for case when MAX_CPUS <=2
parent
00b26f36
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
targets/RT/USER/lte-softmodem.c
+36
-29
36 additions, 29 deletions
targets/RT/USER/lte-softmodem.c
with
36 additions
and
29 deletions
targets/RT/USER/lte-softmodem.c
+
36
−
29
View file @
6e5d7cdd
...
@@ -3298,6 +3298,11 @@ int main( int argc, char **argv )
...
@@ -3298,6 +3298,11 @@ int main( int argc, char **argv )
}
}
#ifndef LOWLATENCY
#ifndef LOWLATENCY
/* Currently we set affinity for UHD to CPU 0 for eNB only and only if number of CPUS >2 */
/* ToDo: Set CPU affinity for UE */
if
(
UE_flag
==
0
&&
get_nprocs
()
>
2
)
{
cpu_set_t
cpuset
;
cpu_set_t
cpuset
;
int
s
;
int
s
;
char
cpu_affinity
[
1024
];
char
cpu_affinity
[
1024
];
...
@@ -3313,8 +3318,8 @@ int main( int argc, char **argv )
...
@@ -3313,8 +3318,8 @@ int main( int argc, char **argv )
perror
(
"pthread_setaffinity_np"
);
perror
(
"pthread_setaffinity_np"
);
exit_fun
(
"Error setting processor affinity"
);
exit_fun
(
"Error setting processor affinity"
);
}
}
/* Check the actual affinity mask assigned to the thread */
/* Check the actual affinity mask assigned to the thread */
s
=
pthread_getaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
s
=
pthread_getaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
if
(
s
!=
0
)
if
(
s
!=
0
)
{
{
...
@@ -3323,14 +3328,16 @@ int main( int argc, char **argv )
...
@@ -3323,14 +3328,16 @@ int main( int argc, char **argv )
}
}
memset
(
cpu_affinity
,
0
,
sizeof
(
cpu_affinity
));
memset
(
cpu_affinity
,
0
,
sizeof
(
cpu_affinity
));
for
(
int
j
=
0
;
j
<
CPU_SETSIZE
;
j
++
)
for
(
int
j
=
0
;
j
<
CPU_SETSIZE
;
j
++
)
{
if
(
CPU_ISSET
(
j
,
&
cpuset
))
if
(
CPU_ISSET
(
j
,
&
cpuset
))
{
{
char
temp
[
1024
];
char
temp
[
1024
];
sprintf
(
temp
,
" CPU_%d "
,
j
);
sprintf
(
temp
,
" CPU_%d "
,
j
);
strcat
(
cpu_affinity
,
temp
);
strcat
(
cpu_affinity
,
temp
);
}
}
}
LOG_I
(
HW
,
"CPU Affinity of main() function is... %s
\n
"
,
cpu_affinity
);
LOG_I
(
HW
,
"CPU Affinity of main() function is... %s
\n
"
,
cpu_affinity
);
}
#endif
#endif
/* device host type is set*/
/* device host type is set*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment