public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat•com>
To: linux-kernel@vger•kernel.org
Cc: 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 <akpm@linux-foundation•org>,
	Michal Hocko <mhocko@suse•com>, Vlastimil Babka <vbabka@suse•cz>,
	Dan Williams <dan.j.williams@intel•com>,
	Pavel Tatashin <pasha.tatashin@oracle•com>,
	Oscar Salvador <osalvador@suse•de>,
	Vitaly Kuznetsov <vkuznets@redhat•com>,
	Martin Schwidefsky <schwidefsky@de•ibm.com>,
	Heiko Carstens <heiko.carstens@de•ibm.com>,
	David Hildenbrand <david@redhat•com>,
	"K . Y . Srinivasan" <kys@microsoft•com>,
	Haiyang Zhang <haiyangz@microsoft•com>,
	Stephen Hemminger <sthemmin@microsoft•com>,
	Benjamin Herrenschmidt <benh@kernel•crashing.org>,
	Paul Mackerras <paulus@samba•org>,
	"Rafael J . Wysocki" <rjw@rjwysocki•net>,
	Len Brown <lenb@kernel•org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
	David Rientjes <rientjes@google•com>
Subject: [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug
Date: Fri, 17 Aug 2018 09:59:00 +0200	[thread overview]
Message-ID: <20180817075901.4608-2-david@redhat.com> (raw)
In-Reply-To: <20180817075901.4608-1-david@redhat.com>

From: Vitaly Kuznetsov <vkuznets@redhat•com>

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 <vkuznets@redhat•com>
[modify patch description]
Signed-off-by: David Hildenbrand <david@redhat•com>
---
 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);
 
 int lock_device_hotplug_sysfs(void)
 {
-- 
2.17.1

  reply	other threads:[~2018-08-17  7:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  7:58 [PATCH RFC 0/2] mm: online/offline_pages called w.o. mem_hotplug_lock David Hildenbrand
2018-08-17  7:59 ` David Hildenbrand [this message]
2018-08-17  8:41   ` [PATCH RFC 1/2] drivers/base: export lock_device_hotplug/unlock_device_hotplug Greg Kroah-Hartman
2018-08-17  8:56     ` David Hildenbrand
2018-08-17  9:03       ` Rafael J. Wysocki
2018-08-17  9:41         ` David Hildenbrand
2018-08-17 10:06           ` Greg Kroah-Hartman
2018-08-17 11:04             ` David Hildenbrand
2018-08-17 11:28               ` Heiko Carstens
2018-08-17 11:56                 ` David Hildenbrand
2018-08-17 17:02                   ` Greg Kroah-Hartman
2018-08-17  8:57     ` Rafael J. Wysocki
2018-08-17  7:59 ` [PATCH RFC 2/2] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock David Hildenbrand
2018-08-17  8:20   ` Rafael J. Wysocki
2018-08-17  8:27     ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180817075901.4608-2-david@redhat.com \
    --to=david@redhat$(echo .)com \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=dan.j.williams@intel$(echo .)com \
    --cc=devel@linuxdriverproject$(echo .)org \
    --cc=gregkh@linuxfoundation$(echo .)org \
    --cc=haiyangz@microsoft$(echo .)com \
    --cc=heiko.carstens@de$(echo .)ibm.com \
    --cc=kys@microsoft$(echo .)com \
    --cc=lenb@kernel$(echo .)org \
    --cc=linux-acpi@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=linux-s390@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mhocko@suse$(echo .)com \
    --cc=osalvador@suse$(echo .)de \
    --cc=pasha.tatashin@oracle$(echo .)com \
    --cc=paulus@samba$(echo .)org \
    --cc=rientjes@google$(echo .)com \
    --cc=rjw@rjwysocki$(echo .)net \
    --cc=schwidefsky@de$(echo .)ibm.com \
    --cc=sthemmin@microsoft$(echo .)com \
    --cc=vbabka@suse$(echo .)cz \
    --cc=vkuznets@redhat$(echo .)com \
    --cc=xen-devel@lists$(echo .)xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox