From e162f880d3ad9797e35796aef6e4a6bf02bd0d2f Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Wed, 16 Nov 2016 16:04:59 +1100 Subject: Limit number of "Poller recursion detected" errors to display In some error conditions, we could spiral out of control on this and spend all of our time printing the exact same backtrace. Limit it to 16 times, because 16 is a nice number. Cc: stable Signed-off-by: Stewart Smith Reviewed-by: Vasant Hegde Signed-off-by: Stewart Smith (cherry picked from commit b6a729e118f42dae88ebf70a09a7e2aa4f788fdc) Signed-off-by: Stewart Smith --- core/opal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/opal.c b/core/opal.c index c2c4d8d..d34d264 100644 --- a/core/opal.c +++ b/core/opal.c @@ -285,11 +285,15 @@ void opal_run_pollers(void) { struct opal_poll_entry *poll_ent; static int pollers_with_lock_warnings = 0; + static int poller_recursion = 0; /* Don't re-enter on this CPU */ - if (this_cpu()->in_poller) { + if (this_cpu()->in_poller && poller_recursion < 16) { prlog(PR_ERR, "OPAL: Poller recursion detected.\n"); backtrace(); + poller_recursion++; + if (poller_recursion == 16) + prlog(PR_ERR, "OPAL: Squashing future poller recursion warnings (>16).\n"); return; } this_cpu()->in_poller = true; -- cgit v1.1