Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp510264imm; Fri, 17 Aug 2018 01:43:11 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx7+D4CkHjpn5U6Bde5tV8j9j7y1Elv906bkrBaiT9425FPM8XhaZnkQ6kcXXrX6//zR3K5 X-Received: by 2002:a63:1015:: with SMTP id f21-v6mr32439320pgl.354.1534495391839; Fri, 17 Aug 2018 01:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534495391; cv=none; d=google.com; s=arc-20160816; b=RbsbnHgu3Ww5taoXM+Myd5SPui7XUqU/h2nPj50qB8qshV6UMUmpjO1dEAlSAW4b4Q Lx3akEnUianZ2derJEFDcmLD8jW6yAkeTO8udutCTFSL5BPk/aaVjw70gLqyJTbKE3Wk mm3xns3jXAJH+lVTdXe+WguTs2I3x1HJvGkGPB/HkDWvOw5xgq2QA7QafBF7uR+rL+IO WgE6EewWJ/CgO/MBNsa+eN6yovRMPi97z+Hizbp97cPOV4wMbE8rL/oV4nmCFR2rRvOD pZrmhgznFt8UvzGkEwvVY6q8X91C6zoWWUOQ7tR6f5WZT3SzjoMuMqC3ee7DjBiRyXyY io6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=EuELpardnTwxXiDH52/usxUX9ARGevV57SBRlKGtMMs=; b=v16soMlTLQ2exktbVDadC17eNTkeYpk/xcvNB2M1ghgl34VXv47g/DSNwSukBlFBg1 IvZptr6jI8kUPpWahPrOGAPjTrKFpgrBV9fOcZ/R9xpr+tS1G4yeHROqQyMSTrJ3UhGu GwIH+HzJGOZLs/mi0X4UKO9WUQbVQkHuSV6p++4i2pNsCZRW6+fjc0HF2KWvq2rU/j0Z eW3TKYhMRqMQypoacGGbbkAV+v7fIWCIpYg2qVFd4qPzI1n2IgslKwbGVKtyLNCz+mcl XnULT4T2GMpP03+DoE/STc6Do8gPgYZYBmEHHQmM1rO2+96cegGjAs9myA2ooq+ZHdfM lvqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si1452239pgg.315.2018.08.17.01.42.55; Fri, 17 Aug 2018 01:43:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbeHQLoX (ORCPT + 99 others); Fri, 17 Aug 2018 07:44:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59276 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbeHQLoW (ORCPT ); Fri, 17 Aug 2018 07:44:22 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 714C7C03; Fri, 17 Aug 2018 08:41:49 +0000 (UTC) Date: Fri, 17 Aug 2018 10:41:46 +0200 From: Greg Kroah-Hartman To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, devel@linuxdriverproject.org, linux-s390@vger.kernel.org, xen-devel@lists.xenproject.org, Andrew Morton , Michal Hocko , Vlastimil Babka , Dan Williams , Pavel Tatashin , Oscar Salvador , Vitaly Kuznetsov , Martin Schwidefsky , Heiko Carstens , "K . Y . Srinivasan" , Haiyang Zhang , Stephen Hemminger , Benjamin Herrenschmidt , Paul Mackerras , "Rafael J . Wysocki" , Len Brown , David Rientjes Subject: Re: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug Message-ID: <20180817084146.GB14725@kroah.com> References: <20180817075901.4608-1-david@redhat.com> <20180817075901.4608-2-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180817075901.4608-2-david@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 17, 2018 at 09:59:00AM +0200, David Hildenbrand wrote: > From: Vitaly Kuznetsov > > Well require to call add_memory()/add_memory_resource() with > device_hotplug_lock held, to avoid a lock inversion. Allow external modules > (e.g. hv_balloon) that make use of add_memory()/add_memory_resource() to > lock device hotplug. > > Signed-off-by: Vitaly Kuznetsov > [modify patch description] > Signed-off-by: David Hildenbrand > --- > drivers/base/core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/base/core.c b/drivers/base/core.c > index 04bbcd779e11..9010b9e942b5 100644 > --- a/drivers/base/core.c > +++ b/drivers/base/core.c > @@ -700,11 +700,13 @@ void lock_device_hotplug(void) > { > mutex_lock(&device_hotplug_lock); > } > +EXPORT_SYMBOL_GPL(lock_device_hotplug); > > void unlock_device_hotplug(void) > { > mutex_unlock(&device_hotplug_lock); > } > +EXPORT_SYMBOL_GPL(unlock_device_hotplug); If these are going to be "global" symbols, let's properly name them. device_hotplug_lock/unlock would be better. But I am _really_ nervous about letting stuff outside of the driver core mess with this, as people better know what they are doing. Can't we just "lock" the memory stuff instead? Why does the entirety of the driver core need to be messed with here? thanks, greg k-h