Re: [PATCH v3 09/11] mm/memory_hotplug: Remove memory block devices before arch_remove_memory()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Michal Hocko <mhocko@xxxxxxxxxx>
- Subject: Re: [PATCH v3 09/11] mm/memory_hotplug: Remove memory block devices before arch_remove_memory()
- From: David Hildenbrand <david@xxxxxxxxxx>
- Date: Mon, 15 Jul 2019 12:58:22 +0200
- Cc: linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, Dan Williams <dan.j.williams@xxxxxxxxx>, Wei Yang <richard.weiyang@xxxxxxxxx>, Igor Mammedov <imammedo@xxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, "mike.travis@xxxxxxx" <mike.travis@xxxxxxx>, Andrew Banman <andrew.banman@xxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>, Oscar Salvador <osalvador@xxxxxxx>, Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>, Pavel Tatashin <pavel.tatashin@xxxxxxxxxxxxx>, Arun KS <arunks@xxxxxxxxxxxxxx>, Mathieu Malaterre <malat@xxxxxxxxxx>
- In-reply-to: <20190701084129.GI6376@dhcp22.suse.cz>
- Openpgp: preference=signencrypt
- Organization: Red Hat GmbH
- References: <20190527111152.16324-1-david@redhat.com> <20190527111152.16324-10-david@redhat.com> <20190701084129.GI6376@dhcp22.suse.cz>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2
On 01.07.19 10:41, Michal Hocko wrote:
> On Mon 27-05-19 13:11:50, David Hildenbrand wrote:
>> Let's factor out removing of memory block devices, which is only
>> necessary for memory added via add_memory() and friends that created
>> memory block devices. Remove the devices before calling
>> arch_remove_memory().
>>
>> This finishes factoring out memory block device handling from
>> arch_add_memory() and arch_remove_memory().
>
> OK, this makes sense again. Just a nit. Calling find_memory_block_by_id
> for each memory block looks a bit suboptimal, especially when we are
> removing consequent physical memblocks. I have to confess that I do not
> know how expensive is the search and I also expect that there won't be
> that many memblocks in the removed range anyway as large setups have
> large memblocks.
>
The devices are not allocated sequentially, so there is no easy way to
look them up.
There is a comment for find_memory_block():
"For now, we have a linear search to go find the appropriate
memory_block corresponding to a particular phys_index. If this gets to
be a real problem, we can always use a radix tree or something here."
So if this becomes a problem, we need a separate data structure to speed
up the lookup. (IOW, this was already the same in the old code)
Thanks!
--
Thanks,
David / dhildenb
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]