Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756190Ab2JTQXx (ORCPT ); Sat, 20 Oct 2012 12:23:53 -0400 Received: from mail-yh0-f46.google.com ([209.85.213.46]:59192 "EHLO mail-yh0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756077Ab2JTQXC (ORCPT ); Sat, 20 Oct 2012 12:23:02 -0400 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Andrew Morton , Steven Rostedt , Paul Gortmaker Subject: [RFC PATCH 6/8] irq_work: Handle queuing without IPI support in dyntick idle mode Date: Sat, 20 Oct 2012 12:22:45 -0400 Message-Id: <1350750167-14263-7-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1350750167-14263-1-git-send-email-fweisbec@gmail.com> References: <1350750167-14263-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: 1703 Lines: 48 If we enqueue a work while in dyntick idle mode and the arch doesn't have self-IPI support, we may not find an opportunity to run the work before a while. In this case, exit the idle loop to re-evaluate irq_work_needs_cpu() and restart the tick. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Andrew Morton Cc: Steven Rostedt Cc: Paul Gortmaker --- kernel/irq_work.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 19f537b..f3bdcf4 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -71,6 +71,17 @@ static void __irq_work_queue(struct irq_work *work, bool ipi) */ if (ipi || !arch_irq_work_has_ipi() || tick_nohz_tick_stopped()) arch_irq_work_raise(); + + /* + * If we rely on the timer tick or some obscure way to run the work + * while the CPU is in dyntick idle mode, we may not have an opportunity + * to do so before a while. Let's just exit the idle loop and hope we + * haven't yet reached the last need_resched() check before the CPU goes + * to low power mode. + */ + if (!arch_irq_work_has_ipi() && tick_nohz_tick_stopped() + && is_idle_task(current)) + set_need_resched(); } preempt_enable(); } -- 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/