All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-acpi@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH v1] ACPI / scan: Acquire device_hotplug_lock in acpi_scan_init()
Date: Fri, 26 Jul 2019 09:57:29 +0200	[thread overview]
Message-ID: <20190726075729.GG6142@dhcp22.suse.cz> (raw)
In-Reply-To: <e31882cf-3290-ea36-77d6-637eaf66fe77@redhat.com>

On Thu 25-07-19 22:49:36, David Hildenbrand wrote:
> On 25.07.19 21:19, Michal Hocko wrote:
[...]
> > We need to rationalize the locking here, not to add more hacks.
> 
> No, sorry. The real hack is calling a function that is *documented* to
> be called under lock without it. That is an optimization for a special
> case. That is the black magic in the code.

OK, let me ask differently. What does the device_hotplug_lock actually
protects from in the add_memory path? (Which data structures)

This function is meant to be used when struct pages and node/zone data
structures should be updated. Why should we even care about some device
concept here? This should all be handled a layer up. Not all memory will
have user space API to control online/offline state.
-- 
Michal Hocko
SUSE Labs

  parent reply	other threads:[~2019-07-26  7:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 14:30 [PATCH v1] ACPI / scan: Acquire device_hotplug_lock in acpi_scan_init() David Hildenbrand
2019-07-25  9:11 ` Rafael J. Wysocki
2019-07-25  9:18 ` Oscar Salvador
2019-07-25  9:22   ` Rafael J. Wysocki
2019-07-25  9:23     ` David Hildenbrand
2019-07-25 12:56 ` Michal Hocko
2019-07-25 13:05   ` David Hildenbrand
2019-07-25 13:57     ` Michal Hocko
2019-07-25 14:35       ` David Hildenbrand
2019-07-25 19:19         ` Michal Hocko
2019-07-25 20:49           ` David Hildenbrand
2019-07-25 21:23             ` Rafael J. Wysocki
2019-07-26  7:20               ` David Hildenbrand
2019-07-26  7:57             ` Michal Hocko [this message]
2019-07-26  8:05               ` David Hildenbrand
2019-07-26  8:31                 ` Michal Hocko
2019-07-26  8:36                   ` David Hildenbrand
2019-07-26  8:44                     ` Michal Hocko
2019-07-26  8:57                       ` David Hildenbrand
2019-07-26 10:31                         ` Michal Hocko
2019-07-26 10:37                           ` 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=20190726075729.GG6142@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.