Re: [PATCH 2/2] mm: hugetlb: Use node interface of cma

From: Vlastimil Babka
Date: Thu Apr 02 2020 - 11:20:07 EST



On 3/27/20 4:13 PM, Michal Hocko wrote:
> On Fri 27-03-20 07:41:55, Roman Gushchin wrote:
>> On Fri, Mar 27, 2020 at 09:06:10AM +0100, Michal Hocko wrote:
>> > On Thu 26-03-20 14:27:18, Aslan Bakirov wrote:
>> > > With introduction of numa node interface for CMA, this patch is for using that
>> > > interface for allocating memory on numa nodes if NUMA is configured.
>> > > This will be more efficient and cleaner because first, instead of iterating
>> > > mem range of each numa node, cma_declare_contigueous_nid() will do
>> > > its own address finding if we pass 0 for both min_pfn and max_pfn,
>> > > second, it can also handle caseswhere NUMA is not configured
>> > > by passing NUMA_NO_NODE as an argument.
>> > >
>> > > In addition, checking if desired size of memory is available or not,
>> > > is happening in cma_declare_contiguous_nid() because base and
>> > > limit will be determined there, since 0(any) for base and
>> > > 0(any) for limit is passed as argument to the function.
>> >
>> > This looks much better than the original patch. Can we simply squash
>> > your and Roman's patch in the mmotm tree and post it for the review in
>> > one piece? It would be slightly easier to review that way.
>>
>> I'm glad you liked it! I agree, it's much nicer now, thanks to Aslan!
>>
>> I think it's simpler to keep it as a separate patch, because there was
>> already a fix by Randy Dunlap on top of my original version.
>
> Why would be squashing all those into a single one be a problem. I will
> not insist of course but I would much rather see a single patch which is
> easy to review and doesn't contain any intermediate hacks to prevent

FWIW, for review purposes, this is Roman's patch with all followups from
mmotm/next (hopefully didn't miss any) and then squashed with patch 2/2 from
this thread. It can be applied like this:

- checkout v5.6
- apply patch 1/2 from this thread
- apply below

----8<----