Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932482AbXAGKnt (ORCPT ); Sun, 7 Jan 2007 05:43:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932484AbXAGKnt (ORCPT ); Sun, 7 Jan 2007 05:43:49 -0500 Received: from e31.co.us.ibm.com ([32.97.110.149]:49349 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932482AbXAGKnq (ORCPT ); Sun, 7 Jan 2007 05:43:46 -0500 Date: Sun, 7 Jan 2007 16:13:28 +0530 From: Srivatsa Vaddagiri To: Oleg Nesterov Cc: Andrew Morton , David Howells , Christoph Hellwig , Ingo Molnar , Linus Torvalds , linux-kernel@vger.kernel.org, Gautham shenoy Subject: Re: [PATCH] fix-flush_workqueue-vs-cpu_dead-race-update Message-ID: <20070107104328.GC13579@in.ibm.com> Reply-To: vatsa@in.ibm.com References: <20061218162701.a3b5bfda.akpm@osdl.org> <20061219004319.GA821@tv-sign.ru> <20070104113214.GA30377@in.ibm.com> <20070104142936.GA179@tv-sign.ru> <20070104091850.c1feee76.akpm@osdl.org> <20070106151036.GA951@tv-sign.ru> <20070106154506.GC24274@in.ibm.com> <20070106163035.GA2948@tv-sign.ru> <20070106163851.GA13579@in.ibm.com> <20070106173416.GA3771@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070106173416.GA3771@tv-sign.ru> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1057 Lines: 28 On Sat, Jan 06, 2007 at 08:34:16PM +0300, Oleg Nesterov wrote: > I suspect this can't help either. > > The problem is that flush_workqueue() may be called while cpu hotplug event > in progress and CPU_DEAD waits for kthread_stop(), so we have the same dead > lock if work->func() does flush_workqueue(). This means that Andrew's change > to use preempt_disable() is good and anyway needed. Well ..a lock_cpu_hotplug() in run_workqueue() and support for recursive calls to lock_cpu_hotplug() by the same thread will avoid the problem you mention. This will need changes to task_struct to track the recursion depth. Alternately this can be supported w/o changes to task_struct by 'biasing' readers over writers as I believe Gautham's patches [1] do. 1. http://lkml.org/lkml/2006/10/26/65 -- Regards, vatsa - 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/