[Oisf-devel] [PATCH 09/10] Handle management thread with corresponding affinity

Eric Leblond eleblond at edenwall.com
Sun Nov 21 13:30:52 UTC 2010


This patch implement the setting of each management threads in
the corresponding thread affinity. This is done by modifiying
thread creation function.

Signed-off-by: Eric Leblond <eleblond at edenwall.com>
---
 src/tm-threads.c    |    2 ++
 src/util-affinity.c |    7 +++++++
 src/util-affinity.h |    1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/tm-threads.c b/src/tm-threads.c
index a8634d9..30542a7 100644
--- a/src/tm-threads.c
+++ b/src/tm-threads.c
@@ -968,6 +968,8 @@ ThreadVars *TmThreadCreateMgmtThread(char *name, void *(fn_p)(void *),
 
     tv = TmThreadCreate(name, NULL, NULL, NULL, NULL, "custom", fn_p, mucond);
 
+    TmThreadSetCPU(tv, MANAGEMENT_CPU_SET);
+
     if (tv != NULL)
         tv->type = TVT_MGMT;
 
diff --git a/src/util-affinity.c b/src/util-affinity.c
index f4b53dd..c27de4e 100644
--- a/src/util-affinity.c
+++ b/src/util-affinity.c
@@ -68,6 +68,13 @@ ThreadsAffinityType thread_affinity[MAX_CPU_SET] = {
         .prio = PRIO_MEDIUM,
         .lcpu = 0,
     },
+    {
+        .name = "management_cpu_set",
+        .mode_flag = BALANCED_AFFINITY,
+        .prio = PRIO_MEDIUM,
+        .lcpu = 0,
+    },
+
 };
 
 /**
diff --git a/src/util-affinity.h b/src/util-affinity.h
index 14d64fb..26670fb 100644
--- a/src/util-affinity.h
+++ b/src/util-affinity.h
@@ -32,6 +32,7 @@ enum {
     DETECT_CPU_SET,
     VERDICT_CPU_SET,
     OUTPUT_CPU_SET,
+    MANAGEMENT_CPU_SET,
     MAX_CPU_SET
 };
 
-- 
1.7.2.3




More information about the Oisf-devel mailing list