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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f35cbe9e-b8bf-127e-698f-d08972d30614@redhat.com>
Date:   Wed, 22 Jan 2020 19:46:15 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     Dan Williams <dan.j.williams@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Leonardo Bras <leonardo@...ux.ibm.com>,
        Nathan Lynch <nathanl@...ux.ibm.com>,
        Allison Randal <allison@...utok.net>,
        Nathan Fontenot <nfont@...ux.vnet.ibm.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Anshuman Khandual <anshuman.khandual@....com>,
        lantianyu1986@...il.com,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

On 22.01.20 19:38, Michal Hocko wrote:
> On Wed 22-01-20 19:15:47, David Hildenbrand wrote:
>> On 22.01.20 17:46, Michal Hocko wrote:
>>> On Wed 22-01-20 12:58:16, David Hildenbrand wrote:
> [...]
>>>> Especially interesting for IBM z Systems, whereby memory
>>>> onlining/offlining will trigger the actual population of memory in the
>>>> hypervisor. So if an admin wants to offline some memory (to give it back
>>>> to the hypervisor), it would use lsmem to identify such blocks first,
>>>> instead of trying random blocks until one offlining request succeeds.
>>>
>>> I am sorry for being dense here but I still do not understand why s390
>>
>> It's good that we talk about it :) It's hard to reconstruct actual use
>> cases from tools and some documentation only ...
>>
>> Side note (just FYI): One difference on s390x compared to other
>> architectures (AFAIKS) is that once memory is offline, you might not be
>> allowed (by the hypervisor) to online it again - because it was
>> effectively unplugged. Such memory is not removed via remove_memory(),
>> it's simply kept offline.
> 
> I have a very vague understanding of s390 specialities but this is not
> really relevant to the discussion AFAICS because this happens _after_
> offlining.

Jep, that's why I flagged it as a side note.

>  
>>> and the way how it does the hotremove matters here. Afterall there are
>>> no arch specific operations done until the memory is offlined. Also
>>> randomly checking memory blocks and then hoping that the offline will
>>> succeed is not way much different from just trying the offline the
>>> block. Both have to crawl through the pfn range and bail out on the
>>> unmovable memory.
>>
>> I think in general we have to approaches to memory unplugging.
>>
>> 1. Know explicitly what you want to unplug (e.g., a DIMM spanning
>> multiple memory blocks).
>>
>> 2. Find random memory blocks you can offline/unplug.
>>
>>
>> For 1, I think we both agree that we don't need this. Just try to
>> offline and you know if it worked.
>>
>> Now of course, for 2 you can try random blocks until you succeeded. From
>> a sysadmin point of view that's very inefficient. From a powerpc-utils
>> point of view, that's inefficient.
> 
> How exactly is check + offline more optimal then offline which makes
> check as its first step? I will get to your later points after this is
> clarified.

Scanning (almost) lockless is more efficient than bouncing back and
forth with the device_hotplug_lock, mem_hotplug_lock, cpu_hotplug_lock
and zone locks - as far as I understand. And as far as I understood,
that was the whole reason of the original commit.

Anyhow, you should have read until the end of my mail to find what you
were looking for :)

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ