From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757232AbZAVLKp (ORCPT ); Thu, 22 Jan 2009 06:10:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751889AbZAVLKg (ORCPT ); Thu, 22 Jan 2009 06:10:36 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:38529 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbZAVLKf (ORCPT ); Thu, 22 Jan 2009 06:10:35 -0500 Subject: Re: [PATCH 2/3] workqueue: not allow recursion run_workqueue From: Peter Zijlstra To: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker Cc: Ingo Molnar , Lai Jiangshan , Oleg Nesterov , Andrew Morton , Eric Dumazet , Linux Kernel Mailing List In-Reply-To: References: <497838F0.7020408@cn.fujitsu.com> <20090122093046.GC5891@nowhere> <20090122093649.GD24758@elte.hu> Content-Type: text/plain; charset="UTF-8" Date: Thu, 22 Jan 2009 12:10:15 +0100 Message-Id: <1232622615.4890.114.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2009-01-22 at 12:06 +0100, Frédéric Weisbecker wrote: > Ok. > Oh but I haven't seen that Oleg said he prefered bug_on, because the > system will deadlock instead....hmm... > > Or perhaps keeping the things like the old way, but with a WARN_ONCE: > > if (cwq->thread == current) { > /* > * Don't ever think to flush workqueue from a work > */ > WARN_ONCE(1); > > run_workqueue(cwq); > active = 1; > } > > And then, the workqueue will flush...so it will behave correctly but > will warn on this bad developer idea of flushing from a work. lockdep already yells at you for doing that, and developers should run with lockdep enabled -- or at least test stuff with lockdep enabled, so I'm not exactly seeing what this will buy us. > Actually I don't understand when Lai says that it will actually not flush. Yeah, his changelog is an utter mistery to many..