[PATCH v6 10/10] mm/memory_hotplug: Cleanup __remove_pages()

David Hildenbrand david at redhat.com
Tue Feb 4 23:41:06 AEDT 2020


On 04.02.20 10:46, Oscar Salvador wrote:
> On Sun, Oct 06, 2019 at 10:56:46AM +0200, David Hildenbrand wrote:
>> Let's drop the basically unused section stuff and simplify.
>>
>> Also, let's use a shorter variant to calculate the number of pages to
>> the next section boundary.
>>
>> Cc: Andrew Morton <akpm at linux-foundation.org>
>> Cc: Oscar Salvador <osalvador at suse.de>
>> Cc: Michal Hocko <mhocko at suse.com>
>> Cc: Pavel Tatashin <pasha.tatashin at soleen.com>
>> Cc: Dan Williams <dan.j.williams at intel.com>
>> Cc: Wei Yang <richardw.yang at linux.intel.com>
>> Signed-off-by: David Hildenbrand <david at redhat.com>
> 
> I have to confess that it took me while to wrap around my head
> with the new min() change, but looks ok:

It's a pattern commonly used in compilers and emulators to calculate the
number of bytes to the next block/alignment. (we're missing a macro
(like we have ALIGN_UP/IS_ALIGNED) for that - but it's hard to come up
with a good name (e.g., SIZE_TO_NEXT_ALIGN) .

-- 
Thanks,

David / dhildenb



More information about the Linuxppc-dev mailing list