lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38d76051-504e-c81a-293a-0b0839e829d3@redhat.com>
Date:   Fri, 26 Jul 2019 10:36:42 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-acpi@...r.kernel.org,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Oscar Salvador <osalvador@...e.de>
Subject: Re: [PATCH v1] ACPI / scan: Acquire device_hotplug_lock in
 acpi_scan_init()

On 26.07.19 10:31, Michal Hocko wrote:
> On Fri 26-07-19 10:05:58, David Hildenbrand wrote:
>> On 26.07.19 09:57, Michal Hocko wrote:
>>> 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.
>>
>> Via add_memory()/__add_memory() we create memory block devices for all
>> memory. So all memory we create via this function (IOW, hotplug) will
>> have user space APIs.
> 
> Ups, I have mixed add_memory with add_pages which I've had in mind while
> writing that. Sorry about the confusion.

No worries :)

> 
> Anyway, my dislike of the device_hotplug_lock persists. I would really
> love to see it go rather than grow even more to the hotplug code. We
> should be really striving for mem hotplug internal and ideally range
> defined locking longterm. 

Yes, and that is a different story, because it will require major
changes to all add_memory() users. (esp, due to the documented race
conditions). Having that said, memory hotplug locking is not ideal yet.

-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ