From 8aa61db4bad6b94a172b838999d0fa273b90e3b2 Mon Sep 17 00:00:00 2001 From: Rohit Gupta <rohit.gupta@eurecom.fr> Date: Sat, 9 Apr 2016 19:54:44 +0200 Subject: [PATCH] CPU Affinity partitioninig between TX/RX threads when not using DEADLINE scheduler --- targets/RT/USER/lte-softmodem.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 4630df4a4f..dbe56f85cb 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -1122,9 +1122,10 @@ static void* eNB_thread_tx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD threads */ + /* CPU 1 is reserved for all TX threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) - CPU_SET(j, &cpuset); + //for (j = 1; j < get_nprocs(); j++) + CPU_SET(1, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (s != 0) @@ -1402,8 +1403,10 @@ static void* eNB_thread_rx( void* param ) /* Set affinity mask to include CPUs 1 to MAX_CPUS */ /* CPU 0 is reserved for UHD */ + /* CPU 1 is reserved for all TX threads */ + /* CPU 2..MAX_CPUS is reserved for all RX threads */ CPU_ZERO(&cpuset); - for (j = 1; j < get_nprocs(); j++) + for (j = 2; j < get_nprocs(); j++) CPU_SET(j, &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); -- 2.26.2