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
OpenXG
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
Show 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 @@
...
@@ -10,6 +10,8 @@
#include <fcntl.h>
#include <fcntl.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/sysinfo.h>
#include <threadPool/thread-pool.h>
#include <threadPool/thread-pool.h>
void
displayList
(
notifiedFIFO_t
*
nf
)
{
void
displayList
(
notifiedFIFO_t
*
nf
)
{
...
@@ -46,12 +48,16 @@ static inline notifiedFIFO_elt_t *pullNotifiedFifoRemember( notifiedFIFO_t *nf,
...
@@ -46,12 +48,16 @@ static inline notifiedFIFO_elt_t *pullNotifiedFifoRemember( notifiedFIFO_t *nf,
void
*
one_thread
(
void
*
arg
)
{
void
*
one_thread
(
void
*
arg
)
{
struct
one_thread
*
myThread
=
(
struct
one_thread
*
)
arg
;
struct
one_thread
*
myThread
=
(
struct
one_thread
*
)
arg
;
struct
thread_pool
*
tp
=
myThread
->
pool
;
struct
thread_pool
*
tp
=
myThread
->
pool
;
// configure the thread core assignment
// configure the thread core assignment
// TBD: reserve the core for us exclusively
// TBD: reserve the core for us exclusively
if
(
myThread
->
coreID
>=
0
&&
myThread
->
coreID
<
get_nprocs_conf
())
{
cpu_set_t
cpuset
;
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
myThread
->
coreID
,
&
cpuset
);
CPU_SET
(
myThread
->
coreID
,
&
cpuset
);
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
pthread_setaffinity_np
(
pthread_self
(),
sizeof
(
cpu_set_t
),
&
cpuset
);
}
//Configure the thread scheduler policy for Linux
//Configure the thread scheduler policy for Linux
struct
sched_param
sparam
=
{
0
};
struct
sched_param
sparam
=
{
0
};
sparam
.
sched_priority
=
sched_get_priority_max
(
SCHED_RR
);
sparam
.
sched_priority
=
sched_get_priority_max
(
SCHED_RR
);
...
@@ -112,22 +118,27 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
...
@@ -112,22 +118,27 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
curptr
=
strtok_r
(
params
,
","
,
&
saveptr
);
curptr
=
strtok_r
(
params
,
","
,
&
saveptr
);
while
(
curptr
!=
NULL
)
{
while
(
curptr
!=
NULL
)
{
if
(
curptr
[
0
]
==
'u'
||
curptr
[
0
]
==
'U'
)
{
int
c
=
toupper
(
curptr
[
0
]);
switch
(
c
)
{
case
'U'
:
pool
->
restrictRNTI
=
true
;
pool
->
restrictRNTI
=
true
;
}
else
if
(
curptr
[
0
]
>=
'0'
&&
curptr
[
0
]
<=
'9'
)
{
break
;
struct
one_thread
*
tmp
=
pool
->
allthreads
;
case
'N'
:
pool
->
activated
=
false
;
break
;
default:
pool
->
allthreads
=
(
struct
one_thread
*
)
malloc
(
sizeof
(
struct
one_thread
));
pool
->
allthreads
=
(
struct
one_thread
*
)
malloc
(
sizeof
(
struct
one_thread
));
pool
->
allthreads
->
next
=
tmp
;
pool
->
allthreads
->
next
=
pool
->
allthreads
;
printf
(
"create a thread for core %d
\n
"
,
atoi
(
curptr
));
printf
(
"create a thread for core %d
\n
"
,
atoi
(
curptr
));
pool
->
allthreads
->
coreID
=
atoi
(
curptr
);
pool
->
allthreads
->
coreID
=
atoi
(
curptr
);
pool
->
allthreads
->
id
=
pool
->
nbThreads
;
pool
->
allthreads
->
id
=
pool
->
nbThreads
;
pool
->
allthreads
->
pool
=
pool
;
pool
->
allthreads
->
pool
=
pool
;
pthread_create
(
&
pool
->
allthreads
->
threadID
,
NULL
,
one_thread
,
(
void
*
)
pool
->
allthreads
);
pthread_create
(
&
pool
->
allthreads
->
threadID
,
NULL
,
one_thread
,
(
void
*
)
pool
->
allthreads
);
pool
->
nbThreads
++
;
pool
->
nbThreads
++
;
}
else
if
(
curptr
[
0
]
==
'n'
||
curptr
[
0
]
==
'N'
)
{
}
pool
->
activated
=
false
;
}
else
printf
(
"Error in options for thread pool: %s
\n
"
,
curptr
);
curptr
=
strtok_r
(
NULL
,
","
,
&
saveptr
);
curptr
=
strtok_r
(
NULL
,
","
,
&
saveptr
);
}
}
...
...
executables/nr-ue.c
View file @
c1b8c6a9
...
@@ -19,16 +19,6 @@
...
@@ -19,16 +19,6 @@
* contact@openairinterface.org
* 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 "executables/nr-uesoftmodem.h"
#include "LAYER2/NR_MAC_UE/mac.h"
#include "LAYER2/NR_MAC_UE/mac.h"
...
@@ -141,10 +131,6 @@ typedef enum {
...
@@ -141,10 +131,6 @@ typedef enum {
si
=
2
si
=
2
}
sync_mode_t
;
}
sync_mode_t
;
int32_t
**
rxdata
;
int32_t
**
txdata
;
#define KHz (1000UL)
#define KHz (1000UL)
#define MHz (1000*KHz)
#define MHz (1000*KHz)
typedef
struct
eutra_band_s
{
typedef
struct
eutra_band_s
{
...
...
executables/nr-uesoftmodem.c
View file @
c1b8c6a9
...
@@ -709,7 +709,7 @@ int main( int argc, char **argv ) {
...
@@ -709,7 +709,7 @@ int main( int argc, char **argv ) {
set_taus_seed
(
0
);
set_taus_seed
(
0
);
tpool_t
pool
;
tpool_t
pool
;
Tpool
=
&
pool
;
Tpool
=
&
pool
;
char
params
[]
=
"
1,2,3,u
"
;
char
params
[]
=
"
-1,-1,-1,-1
"
;
initTpool
(
params
,
Tpool
,
false
);
initTpool
(
params
,
Tpool
,
false
);
cpuf
=
get_cpu_freq_GHz
();
cpuf
=
get_cpu_freq_GHz
();
itti_init
(
TASK_MAX
,
THREAD_MAX
,
MESSAGES_ID_MAX
,
tasks_info
,
messages_info
);
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