Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]) by bombadil.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1KTJfZ-0002JT-0f for kexec@lists.infradead.org; Wed, 13 Aug 2008 16:57:57 +0000 Date: Wed, 13 Aug 2008 09:57:33 -0700 (PDT) From: Linus Torvalds Subject: Re: [PATCH] kexec jump: fix compiling warning on xchg(&kexec_lock, 0) in kernel_kexec() In-Reply-To: <1218618760.24951.137.camel@caritas-dev.intel.com> Message-ID: References: <1218618760.24951.137.camel@caritas-dev.intel.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Huang Ying Cc: nigel@nigel.suspend2.net, Kexec Mailing List , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , "Eric W. Biederman" , Pavel Machek , Andrew Morton , mingo@elte.hu, Vivek Goyal On Wed, 13 Aug 2008, Huang Ying wrote: > > - xchg(&kexec_lock, 0); > + locked = xchg(&kexec_lock, 0); > + BUG_ON(!locked); Why do you want to do this at all? And why do you implement your locks with xchg() in the first place? That's total and utter crap. Hint: we have _real_ locking primitives in the kernel. Linus _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec