Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751603Ab2KPCV7 (ORCPT ); Thu, 15 Nov 2012 21:21:59 -0500 Received: from mail-vc0-f174.google.com ([209.85.220.174]:61094 "EHLO mail-vc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750804Ab2KPCVz (ORCPT ); Thu, 15 Nov 2012 21:21:55 -0500 From: Frederic Weisbecker To: LKML Cc: Steven Rostedt , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Andrew Morton , Paul Gortmaker , Frederic Weisbecker Subject: [PATCH 7/9] irq_work: Warn if there's still work on cpu_down Date: Fri, 16 Nov 2012 03:21:29 +0100 Message-Id: <1353032491-16462-8-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1353032491-16462-1-git-send-email-fweisbec@gmail.com> References: <1353032491-16462-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 41 From: Steven Rostedt If we are in nohz and there's still irq_work to be done when the idle task is about to go offline, give a nasty warning. Everything should have been flushed from the CPU_DYING notifier already. Further attempts to enqueue an irq_work are buggy because irqs are disabled by __cpu_disable(). The best we can do is to report the issue to the user. Signed-off-by: Steven Rostedt Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Andrew Morton Cc: Paul Gortmaker Signed-off-by: Frederic Weisbecker --- kernel/irq_work.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/irq_work.c b/kernel/irq_work.c index cf8b657..fcaadae 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -108,6 +108,9 @@ bool irq_work_needs_cpu(void) if (llist_empty(this_list)) return false; + /* All work should have been flushed before going offline */ + WARN_ON_ONCE(cpu_is_offline(smp_processor_id())); + return true; } -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/