Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932553AbXAGOli (ORCPT ); Sun, 7 Jan 2007 09:41:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932558AbXAGOli (ORCPT ); Sun, 7 Jan 2007 09:41:38 -0500 Received: from mail.screens.ru ([213.234.233.54]:49975 "EHLO mail.screens.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932557AbXAGOlh (ORCPT ); Sun, 7 Jan 2007 09:41:37 -0500 Date: Sun, 7 Jan 2007 17:42:36 +0300 From: Oleg Nesterov To: Srivatsa Vaddagiri 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: <20070107144236.GB149@tv-sign.ru> References: <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> <20070107104328.GC13579@in.ibm.com> <20070107125603.GA74@tv-sign.ru> <20070107142246.GA149@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070107142246.GA149@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: 831 Lines: 27 On 01/07, Oleg Nesterov wrote: > > How about: > > CPU_DEAD does nothing. After __cpu_disable() cwq->thread runs on > all CPUs and becomes idle when it flushes cwq->worklist: nobody > will add work_struct on that list. Also, we can add cpu_workqueue_struct->should_exit_after_flush flag, but we have to be careful to serialize with destroy_workqueue/CPU_UP. > CPU_UP: > if (!cwq->thread) > create_workqueue_thread(); > else > set_cpus_allowed(newcpu); > > flush_workqueue: > for_each_possible_cpu() // NOT online! > if (cwq->thread) > flush_cpu_workqueue() - 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/