2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00

poll: Suppress logging for pmd threads.

'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>
This commit is contained in:
Ilya Maximets
2015-12-22 17:26:47 +03:00
committed by Ben Pfaff
parent 4c7bf534f5
commit 2f8932e840
4 changed files with 14 additions and 2 deletions

View 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);
}
/* ovsthread_key. */

View 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 */

View 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;

View 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();