Re: [PATCH v1] mm/memory_hotplug: don't check the nid in find_(smallest|biggest)_section_pfn

From: David Hildenbrand
Date: Wed Nov 27 2019 - 15:49:26 EST


On 27.11.19 20:52, David Hildenbrand wrote:
>
>
>> Am 27.11.2019 um 20:37 schrieb Qian Cai <cai@xxxxxx>:
>>
>> ï
>>
>>> On Nov 27, 2019, at 2:06 PM, David Hildenbrand <david@xxxxxxxxxx> wrote:
>>>
>>> The zone pointer is unique for every node. (in contrast to the zone index).
>>
>> I am not sure if it is worth optimizing there. The existing nid check looks quite straight-forward and cheap.
>
> I understand but strongly dislike your attitude towards code changes ;)
>

I think that came out wrong, let me rephrase:

This is not a performance optimization but a cleanup. Once you
understood how zone pointers work, you immediately see why the nid
checks are only here for legacy reasons (see "mm/memory_hotplug: we
always have a zone in find_(smallest|biggest)_section_pfn" in linux-next).

(I am a friend of cleaning up and refactoring code to make it easier to
understand, maintain and extend. I was assuming your mentality is to
rather keeping code changes minimal if there is a chance to break things
- I'm sorry if that assumption was wrong.)

--
Thanks,

David / dhildenb