You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2013/03/10 00:23:02 UTC

git commit: [TS-1744] ats run with 1 less event thread then it is supposed to, for both auto and manual thread config

Updated Branches:
  refs/heads/master c08d8d264 -> 67e15ea46


[TS-1744] ats run with 1 less event thread then it is supposed to, for
both auto and manual thread config


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/67e15ea4
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/67e15ea4
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/67e15ea4

Branch: refs/heads/master
Commit: 67e15ea460a0057ce7e04e73ee4bb4c642749dc0
Parents: c08d8d2
Author: Bryan Call <bc...@apache.org>
Authored: Sat Mar 9 15:22:46 2013 -0800
Committer: Bryan Call <bc...@apache.org>
Committed: Sat Mar 9 15:22:46 2013 -0800

----------------------------------------------------------------------
 CHANGES                                  |    3 +++
 iocore/eventsystem/UnixEventProcessor.cc |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/67e15ea4/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9f24b6b..68485be 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
   Changes with Apache Traffic Server 3.3.2
 
+  *) [TS-1744] ats run with 1 less event thread then it is supposed to, for
+  both auto and manual thread config
+
   *) [TS-1356] Ability to set thread affinity with multiple modes
 
   

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/67e15ea4/iocore/eventsystem/UnixEventProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 1efdf0b..5a15ea5 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -174,8 +174,8 @@ EventProcessor::start(int n_event_threads)
   Debug("iocore_thread", "socket: %d core: %d logical processor: %d affinity: %d", socket, cu, pu, affinity);
 #endif
 
-  for (i = first_thread; i < n_ethreads; i++) {
-    snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[ET_NET %d]", i);
+  for (i = 0; i < n_ethreads; i++) {
+    snprintf(thr_name, MAX_THREAD_NAME_LENGTH, "[ET_NET %d]", i + 1);
     ink_thread tid = all_ethreads[i]->start(thr_name);
     (void)tid;
 
@@ -197,7 +197,7 @@ EventProcessor::start(int n_event_threads)
       char debug_message[256];
       int len = snprintf(debug_message, sizeof(debug_message), "setaffinity tid: %" PTR_FMT ", net thread: %u cpu:", tid, i);
       for (int cpu_count = 0; cpu_count < logical_ratio; cpu_count++) {
-        int cpu = ((i - 1) * logical_ratio + cpu_count) % pu;
+        int cpu = (i * logical_ratio + cpu_count) % pu;
         set_cpu(&cpuset, cpu);
         len += snprintf(debug_message + len, sizeof(debug_message) - len, " %d", cpu);
       }