Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752545AbbKOIQS (ORCPT ); Sun, 15 Nov 2015 03:16:18 -0500 Received: from www.linutronix.de ([62.245.132.108]:35940 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752378AbbKOIQP (ORCPT ); Sun, 15 Nov 2015 03:16:15 -0500 Date: Sun, 15 Nov 2015 09:15:27 +0100 (CET) From: Thomas Gleixner To: yjin cc: Steven Rostedt , mingo@redhat.com, bigeasy@linutronix.de, peterz@infradead.org, linux-kernel@vger.kernel.org, jinyanjiang@gmail.com, stable-rt@vger.kernel.org, linux-rt-users@vger.kernel.org Subject: Re: [RT PATCH] sched: rt: fix two possible deadlocks in push_irq_work_func In-Reply-To: <5646BB4A.50307@windriver.com> Message-ID: References: <1447469598-31876-1-git-send-email-yanjiang.jin@windriver.com> <20151113232512.53df431f@gandalf.local.home> <5646BB4A.50307@windriver.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-2083429900-1447575328=:3761" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 45 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2083429900-1447575328=:3761 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sat, 14 Nov 2015, yjin wrote: > On 2015年11月14日 12:25, Steven Rostedt wrote: > > On Sat, 14 Nov 2015 10:53:18 +0800 > > wrote: > > > > > From: Yanjiang Jin > > > > > > This can only happen in RT kernel due to run_timer_softirq() calls > > > irq_work_tick() when CONFIG_PREEMPT_RT_FULL is enabled as below: > > > > > > static void run_timer_softirq(struct softirq_action *h) > > > { > > > ........ > > > if defined(CONFIG_IRQ_WORK) && defined(CONFIG_PREEMPT_RT_FULL) > > > irq_work_tick(); > > > endif > > > ........ > > > } > > > > > > Use raw_spin_{un,}lock_irq{save,restore} in push_irq_work_func() to > > > prevent following potentially deadlock scenario: > > Ug. No, the real fix is that the irq work is to be run from hard > > interrupt context. > But if so, we shouldn't call irq_work_tick() in run_timer_softirq(), right? The work is marked IRQ_WORK_HARD_IRQ so it should be run from hard irq context. We only run the work, which is not marked IRQ_WORK_HARD_IRQ from the softirq on RT. Thanks, tglx --8323329-2083429900-1447575328=:3761-- -- 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/