From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753034AbaBNSb4 (ORCPT ); Fri, 14 Feb 2014 13:31:56 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:35191 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752996AbaBNSbx (ORCPT ); Fri, 14 Feb 2014 13:31:53 -0500 Date: Fri, 14 Feb 2014 13:31:47 -0500 (EST) Message-Id: <20140214.133147.1908176449942033339.davem@davemloft.net> To: srivatsa.bhat@linux.vnet.ibm.com Cc: paulus@samba.org, oleg@redhat.com, mingo@kernel.org, rusty@rustcorp.com.au, peterz@infradead.org, tglx@linutronix.de, akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com, tj@kernel.org, walken@google.com, ego@linux.vnet.ibm.com, linux@arm.linux.org.uk, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, ursula.braun@de.ibm.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 52/52] net/iucv/iucv.c: Fix CPU hotplug callback registration From: David Miller In-Reply-To: <20140214080057.22701.94737.stgit@srivatsabhat.in.ibm.com> References: <20140214074750.22701.47330.stgit@srivatsabhat.in.ibm.com> <20140214080057.22701.94737.stgit@srivatsabhat.in.ibm.com> X-Mailer: Mew version 6.5 on Emacs 24.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.7 (shards.monkeyblade.net [149.20.54.216]); Fri, 14 Feb 2014 10:31:53 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Srivatsa S. Bhat" Date: Fri, 14 Feb 2014 13:30:58 +0530 > Subsystems that want to register CPU hotplug callbacks, as well as perform > initialization for the CPUs that are already online, often do it as shown > below: ... > This is wrong, since it is prone to ABBA deadlocks involving the > cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently > with CPU hotplug operations). > > Instead, the correct and race-free way of performing the callback > registration is: ... > Fix the code in net/iucv/iucv.c by using this latter form of callback > registration. Also, provide helper functions to perform the common memory > allocations and frees, to condense repetitive code. > > Cc: Ursula Braun > Cc: Ingo Molnar > Cc: linux-s390@vger.kernel.org > Cc: netdev@vger.kernel.org > Signed-off-by: David S. Miller > Signed-off-by: Srivatsa S. Bhat Acked-by: David S. Miller