Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965067AbbLCOsT (ORCPT ); Thu, 3 Dec 2015 09:48:19 -0500 Received: from mail-yk0-f178.google.com ([209.85.160.178]:33921 "EHLO mail-yk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964954AbbLCOsQ (ORCPT ); Thu, 3 Dec 2015 09:48:16 -0500 Date: Thu, 3 Dec 2015 09:48:11 -0500 From: Tejun Heo To: Peter Zijlstra Cc: Ulrich Obergfell , Ingo Molnar , Andrew Morton , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 1/2] watchdog: introduce touch_softlockup_watchdog_sched() Message-ID: <20151203144811.GA27463@mtj.duckdns.org> References: <20151203002810.GJ19878@mtj.duckdns.org> <20151203093350.GP17308@twins.programming.kicks-ass.net> <20151203100018.GO11639@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151203100018.GO11639@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1357 Lines: 36 Hey, Peter. On Thu, Dec 03, 2015 at 11:00:18AM +0100, Peter Zijlstra wrote: > > have you considered something as simple as: > > > > WARN_ON(current->reclaim_state && !WQ_MEM_RECLAIM); > > > > ? > > Alternatively, you can 'abuse' the lockdep reclaim bits by marking > !MEM_RECLAIM workqueue 'locks' with lockdep_trace_alloc(GFP_KERNEL), > that way lockdep will yell if they get used in a reclaim context. > > This might be a tad tricky in that you need 2 sets of (lockdep) keys for > things. One of the latest bugs was an xfs work item in reclaim path which had WQ_MEM_RECLAIM waiting on a waitqueue for an event which is to be triggered by another work item which incorrectly was missing the flag. Under memory pressure, it leads to silent deadlocks. The other one was vmstat update work busy looping waiting for a work item which is queued behind it. None of the dependency tracking mechanisms could have detected either and both were pretty tricky to track down. We can add MEM_RECLAIM -> !MEM_RECLAIM warning mechanism in addition but I think adding stall detection is justified. Thanks. -- tejun -- 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/