summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-06-23 15:10:34 +0200
committerDaniel Cederman <cederman@gaisler.com>2014-06-27 11:03:25 +0200
commit24641baa5245f9248c1d972e605238d44f7254f4 (patch)
treee72a26af22460d774d10a18d81539db232128e68
parent034caa1e1f2078c3119a3b0a1630b341cf9d8175 (diff)
NFS RPCd task affinity config option
Similar to the task priority option the new CPU Affinity option is fist controlled by the RPCI specific rpciodCpuset option and then the global network task config and then falls back to not setting the affinity (all CPUs)
-rw-r--r--cpukit/libfs/src/nfsclient/src/rpcio.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpukit/libfs/src/nfsclient/src/rpcio.c b/cpukit/libfs/src/nfsclient/src/rpcio.c
index 7324e02fd9..aeeb275b69 100644
--- a/cpukit/libfs/src/nfsclient/src/rpcio.c
+++ b/cpukit/libfs/src/nfsclient/src/rpcio.c
@@ -84,6 +84,9 @@
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef RTEMS_SMP
+#include <sys/cpuset.h>
+#endif
#include "rpcio.h"
@@ -407,6 +410,7 @@ static rtems_interval ticksPerSec; /* cached system clock rate (WHO IS ASSUMED
*/
rtems_task_priority rpciodPriority = 0;
+cpu_set_t rpciodCpuset;
#if (DEBUG) & DEBUG_MALLOC
/* malloc wrappers for debugging */
@@ -983,6 +987,13 @@ struct sockwakeup wkup;
&rpciod);
assert( status == RTEMS_SUCCESSFUL );
+#ifdef RTEMS_SMP
+ if (CPU_EMPTY(&rpciodCpuset))
+ CPU_COPY(&rpciodCpuset, &rtems_bsdnet_config.network_task_cpuset);
+ if (!CPU_EMPTY(&rpciodCpuset))
+ rtems_task_set_affinity(rpciod, sizeof(cpu_set_t), &rpciodCpuset);
+#endif
+
wkup.sw_pfn = rxWakeupCB;
wkup.sw_arg = &rpciod;
assert( 0==setsockopt(ourSock, SOL_SOCKET, SO_RCVWAKEUP, &wkup, sizeof(wkup)) );