Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261708AbVEaKlO (ORCPT ); Tue, 31 May 2005 06:41:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261777AbVEaKlN (ORCPT ); Tue, 31 May 2005 06:41:13 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:25284 "EHLO e1.ny.us.ibm.com") by vger.kernel.org with ESMTP id S261708AbVEaKkq (ORCPT ); Tue, 31 May 2005 06:40:46 -0400 Date: Tue, 31 May 2005 16:10:55 +0530 From: Srivatsa Vaddagiri To: Nick Piggin Cc: Shaohua Li , lkml , akpm , Ingo Molnar , Rusty Russell , ashok.raj@intel.com Subject: Re: [PATCH]CPU hotplug breaks wake_up_new_task Message-ID: <20050531104055.GA9908@in.ibm.com> Reply-To: vatsa@in.ibm.com References: <1117524909.3820.11.camel@linux-hp.sh.intel.com> <20050531094045.GA9884@in.ibm.com> <429C3265.4010704@yahoo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <429C3265.4010704@yahoo.com.au> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1063 Lines: 38 On Tue, May 31, 2005 at 07:46:13PM +1000, Nick Piggin wrote: > And this patch will break balance-on-fork. Right :-) > How about conditionally setting task_cpu if the task's current > CPU is offline? Something like this? --- kernel/fork.c.org 2005-05-31 14:57:15.000000000 +0530 +++ kernel/fork.c 2005-05-31 16:06:41.000000000 +0530 @@ -1024,7 +1024,8 @@ static task_t *copy_process(unsigned lon * parent's CPU). This avoids alot of nasty races. */ p->cpus_allowed = current->cpus_allowed; - if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed))) + if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) || + !cpu_online(task_cpu(p)))) set_task_cpu(p, smp_processor_id()); /* -- Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560017 - 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/