Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755402Ab3DOQEM (ORCPT ); Mon, 15 Apr 2013 12:04:12 -0400 Received: from relay1.sgi.com ([192.48.179.29]:42950 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019Ab3DOQEK (ORCPT ); Mon, 15 Apr 2013 12:04:10 -0400 Date: Mon, 15 Apr 2013 11:04:08 -0500 From: Robin Holt To: Oleg Nesterov Cc: Robin Holt , "Srivatsa S. Bhat" , Ingo Molnar , Paul Mackerras , Linus Torvalds , "H. Peter Anvin" , Andrew Morton , Linux Kernel Mailing List , Russ Anderson , Shawn Guo , Thomas Gleixner , Ingo Molnar , the arch/x86 maintainers , "Paul E. McKenney" , Tejun Heo , Lai Jiangshan , Michel Lespinasse , "rusty@rustcorp.com.au" , Peter Zijlstra Subject: Re: Bulk CPU Hotplug (Was Re: [PATCH] Do not force shutdown/reboot to boot cpu.) Message-ID: <20130415160408.GA3658@sgi.com> References: <20130408165916.GA3672@sgi.com> <20130410111620.GB29752@gmail.com> <20130411053106.GA9042@drongo> <5166B05E.8010904@linux.vnet.ibm.com> <20130411134837.GE3672@sgi.com> <20130412053718.GC3887@gmail.com> <5167A52F.6020503@linux.vnet.ibm.com> <20130412093149.GT3658@sgi.com> <20130413163022.GA7500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130413163022.GA7500@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1066 Lines: 28 On Sat, Apr 13, 2013 at 06:30:22PM +0200, Oleg Nesterov wrote: > On 04/12, Robin Holt wrote: > > > > +void migrate_to_boot_cpu(void) > > +{ > > + /* The boot cpu is always logical cpu 0 */ > > + int reboot_cpu_id = 0; > > + > > + /* Make certain the cpu I'm about to reboot on is online */ > > + if (!cpu_online(reboot_cpu_id)) > > + reboot_cpu_id = smp_processor_id(); > > + > > + /* Make certain I only run on the appropriate processor */ > > + set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id)); > > This is only theoretical, but perhaps it makes sense to set > PF_THREAD_BOUND before set_cpus_allowed_ptr() ? To prevent the > race with another thread doing sched_setaffinity(). I don't quite understand this comment. We are migrating our own thread. How does setting PF_THREAD_BOUND have any effect? Robin -- 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/