poll: Suppress logging for pmd threads.
authorIlya Maximets <i.maximets@samsung.com>
Tue, 22 Dec 2015 14:26:47 +0000 (17:26 +0300)
committerBen Pfaff <blp@ovn.org>
Mon, 11 Jan 2016 17:59:49 +0000 (09:59 -0800)
'Unreasonably long poll interval's are reasonable for PMD threads.
Also reporting of high CPU usage is not necessary.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/ovs-thread.c
lib/ovs-thread.h
lib/poll-loop.c
lib/timeval.c

index 2f6bc58..7855b3a 100644 (file)
@@ -584,6 +584,15 @@ count_cpu_cores(void)
 
     return n_cores > 0 ? n_cores : 0;
 }
+
+/* Returns 'true' if current thread is PMD thread. */
+bool
+thread_is_pmd(void)
+{
+    const char *name = get_subprogram_name();
+    return !strncmp(name, "pmd", 3);
+}
+
 \f
 /* ovsthread_key. */
 
index 26b2ccd..55e51a4 100644 (file)
@@ -523,5 +523,6 @@ bool may_fork(void);
 /* Useful functions related to threading. */
 
 int count_cpu_cores(void);
+bool thread_is_pmd(void);
 
 #endif /* ovs-thread.h */
index 60e1f6e..e83d989 100644 (file)
@@ -253,7 +253,9 @@ log_wakeup(const char *where, const struct pollfd *pollfd, int timeout)
     cpu_usage = get_cpu_usage();
     if (VLOG_IS_DBG_ENABLED()) {
         level = VLL_DBG;
-    } else if (cpu_usage > 50 && !VLOG_DROP_INFO(&rl)) {
+    } else if (cpu_usage > 50
+               && !thread_is_pmd()
+               && !VLOG_DROP_INFO(&rl)) {
         level = VLL_INFO;
     } else {
         return;
index 8f1c97f..d390df1 100644 (file)
@@ -270,7 +270,7 @@ time_poll(struct pollfd *pollfds, int n_pollfds, HANDLE *handles OVS_UNUSED,
     time_init();
     coverage_clear();
     coverage_run();
-    if (*last_wakeup) {
+    if (*last_wakeup && !thread_is_pmd()) {
         log_poll_interval(*last_wakeup);
     }
     start = time_msec();