Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
c1b8c6a9
Commit
c1b8c6a9
authored
Mar 21, 2019
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new thread model - make affinity optional
parent
1f134370
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
35 deletions
+32
-35
common/utils/threadPool/thread-pool.c
common/utils/threadPool/thread-pool.c
+31
-20
executables/nr-ue.c
executables/nr-ue.c
+0
-14
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+1
-1
No files found.
common/utils/threadPool/thread-pool.c
View file @
c1b8c6a9
...
...
@@ -10,6 +10,8 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/sysinfo.h>
#include <threadPool/thread-pool.h>
void
displayList
(
notifiedFIFO_t
*
nf
)
{
...
...
@@ -46,12 +48,16 @@ static inline notifiedFIFO_elt_t *pullNotifiedFifoRemember( notifiedFIFO_t *nf,
void
*
one_thread
(
void
*
arg
)
{
struct
one_thread
*
myThread
=
(
struct
one_thread
*
)
arg
;
struct
thread_pool
*
tp
=
myThread
->
pool
;
// configure the thread core assignment
// TBD: reserve the core for us exclusively
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
myThread
->
coreID
,
&
cpuset
);
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
if
(
myThread
->
coreID
>=
0
&&
myThread
->
coreID
<
get_nprocs_conf
())
{
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
myThread
->
coreID
,
&
cpuset
);
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
}
//Configure the thread scheduler policy for Linux
struct
sched_param
sparam
=
{
0
};
sparam
.
sched_priority
=
sched_get_priority_max
(
SCHED_RR
);
...
...
@@ -112,22 +118,27 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
curptr
=
strtok_r
(
params
,
","
,
&
saveptr
);
while
(
curptr
!=
NULL
)
{
if
(
curptr
[
0
]
==
'u'
||
curptr
[
0
]
==
'U'
)
{
pool
->
restrictRNTI
=
true
;
}
else
if
(
curptr
[
0
]
>=
'0'
&&
curptr
[
0
]
<=
'9'
)
{
struct
one_thread
*
tmp
=
pool
->
allthreads
;
pool
->
allthreads
=
(
struct
one_thread
*
)
malloc
(
sizeof
(
struct
one_thread
));
pool
->
allthreads
->
next
=
tmp
;
printf
(
"create a thread for core %d
\n
"
,
atoi
(
curptr
));
pool
->
allthreads
->
coreID
=
atoi
(
curptr
);
pool
->
allthreads
->
id
=
pool
->
nbThreads
;
pool
->
allthreads
->
pool
=
pool
;
pthread_create
(
&
pool
->
allthreads
->
threadID
,
NULL
,
one_thread
,
(
void
*
)
pool
->
allthreads
);
pool
->
nbThreads
++
;
}
else
if
(
curptr
[
0
]
==
'n'
||
curptr
[
0
]
==
'N'
)
{
pool
->
activated
=
false
;
}
else
printf
(
"Error in options for thread pool: %s
\n
"
,
curptr
);
int
c
=
toupper
(
curptr
[
0
]);
switch
(
c
)
{
case
'U'
:
pool
->
restrictRNTI
=
true
;
break
;
case
'N'
:
pool
->
activated
=
false
;
break
;
default:
pool
->
allthreads
=
(
struct
one_thread
*
)
malloc
(
sizeof
(
struct
one_thread
));
pool
->
allthreads
->
next
=
pool
->
allthreads
;
printf
(
"create a thread for core %d
\n
"
,
atoi
(
curptr
));
pool
->
allthreads
->
coreID
=
atoi
(
curptr
);
pool
->
allthreads
->
id
=
pool
->
nbThreads
;
pool
->
allthreads
->
pool
=
pool
;
pthread_create
(
&
pool
->
allthreads
->
threadID
,
NULL
,
one_thread
,
(
void
*
)
pool
->
allthreads
);
pool
->
nbThreads
++
;
}
curptr
=
strtok_r
(
NULL
,
","
,
&
saveptr
);
}
...
...
executables/nr-ue.c
View file @
c1b8c6a9
...
...
@@ -19,16 +19,6 @@
* contact@openairinterface.org
*/
/*! \file lte-ue.c
* \brief threads and support functions for real-time LTE UE target
* \author R. Knopp, F. Kaltenberger, Navid Nikaein
* \date 2015
* \version 0.1
* \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
* \note
* \warning
*/
#include "executables/nr-uesoftmodem.h"
#include "LAYER2/NR_MAC_UE/mac.h"
...
...
@@ -141,10 +131,6 @@ typedef enum {
si
=
2
}
sync_mode_t
;
int32_t
**
rxdata
;
int32_t
**
txdata
;
#define KHz (1000UL)
#define MHz (1000*KHz)
typedef
struct
eutra_band_s
{
...
...
executables/nr-uesoftmodem.c
View file @
c1b8c6a9
...
...
@@ -709,7 +709,7 @@ int main( int argc, char **argv ) {
set_taus_seed
(
0
);
tpool_t
pool
;
Tpool
=
&
pool
;
char
params
[]
=
"
1,2,3,u
"
;
char
params
[]
=
"
-1,-1,-1,-1
"
;
initTpool
(
params
,
Tpool
,
false
);
cpuf
=
get_cpu_freq_GHz
();
itti_init
(
TASK_MAX
,
THREAD_MAX
,
MESSAGES_ID_MAX
,
tasks_info
,
messages_info
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment