From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262081AbTLUC4J (ORCPT ); Sat, 20 Dec 2003 21:56:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262116AbTLUC4J (ORCPT ); Sat, 20 Dec 2003 21:56:09 -0500 Received: from mail-02.iinet.net.au ([203.59.3.34]:42637 "HELO mail.iinet.net.au") by vger.kernel.org with SMTP id S262081AbTLUC4G (ORCPT ); Sat, 20 Dec 2003 21:56:06 -0500 Message-ID: <3FE50BC2.6050602@cyberone.com.au> Date: Sun, 21 Dec 2003 13:56:02 +1100 From: Nick Piggin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030827 Debian/1.4-3 X-Accept-Language: en MIME-Version: 1.0 To: Rusty Russell CC: linux-kernel , Anton Blanchard , Ingo Molnar , "Martin J. Bligh" , "Nakajima, Jun" , Mark Wong , John Hawkes Subject: Re: [CFT][RFC] HT scheduler References: <20031221003020.6F4482C0D1@lists.samba.org> In-Reply-To: <20031221003020.6F4482C0D1@lists.samba.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Rusty Russell wrote: >In message <3FE28529.1010003@cyberone.com.au> you write: > >>+ * See comment for set_cpus_allowed. calling rules are different: >>+ * the task's runqueue lock must be held, and __set_cpus_allowed >>+ * will return with the runqueue unlocked. >> > >Please, never *ever* do this. > >Locking is probably the hardest thing to get right, and code like this >makes it harder. > Although in this case it is only one lock, and its only used in one place, with comments. But yeah its far more complex than a blocking semaphore would be. > >Fortunately, there is a simple solution coming with the hotplug CPU >code: we need to hold the cpucontrol semaphore here anyway, against >cpus vanishing. > >Perhaps we should just use that in both places. > We could just use a private semaphore until the hotplug code is in place.