All of lore.kernel.org
 help / color / mirror / Atom feed
* [LSF/MM TOPIC] CMA and larger page sizes
@ 2018-01-26 10:08 Laura Abbott
  2018-01-26 17:25 ` Michal Hocko
  2018-04-17 11:36 ` Michal Hocko
  0 siblings, 2 replies; 11+ messages in thread
From: Laura Abbott @ 2018-01-26 10:08 UTC (permalink / raw)
  To: lsf-pc, linux-mm

CMA as it's currently designed requires alignment to the pageblock size c.f.

         /*
          * Sanitise input arguments.
          * Pages both ends in CMA area could be merged into adjacent unmovable
          * migratetype page by page allocator's buddy algorithm. In the case,
          * you couldn't get a contiguous memory, which is not what we want.
          */
         alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
                           max_t(unsigned long, MAX_ORDER - 1, pageblock_order));


On arm64 with 64K page size and transparent huge page, this gives an alignment
of 512MB. This is quite restrictive and can eat up significant portions of
memory on smaller memory targets. Adjusting the configuration options really
isn't ideal for distributions that aim to have a single image which runs on
all targets.

Approaches I've thought about:
- Making CMA alignment less restrictive (and dealing with the fallout from
the comment above)
- Command line option to force a reasonable alignment

There's been some interest in other CMA topics so this might go along well.

Thanks,
Laura

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-01-26 10:08 [LSF/MM TOPIC] CMA and larger page sizes Laura Abbott
@ 2018-01-26 17:25 ` Michal Hocko
  2018-04-04  5:11   ` Joonsoo Kim
  2018-04-17 11:36 ` Michal Hocko
  1 sibling, 1 reply; 11+ messages in thread
From: Michal Hocko @ 2018-01-26 17:25 UTC (permalink / raw)
  To: Laura Abbott; +Cc: lsf-pc, linux-mm, Joonsoo Kim

[Ccing Joonsoo]

On Fri 26-01-18 02:08:14, Laura Abbott wrote:
> CMA as it's currently designed requires alignment to the pageblock size c.f.
> 
>         /*
>          * Sanitise input arguments.
>          * Pages both ends in CMA area could be merged into adjacent unmovable
>          * migratetype page by page allocator's buddy algorithm. In the case,
>          * you couldn't get a contiguous memory, which is not what we want.
>          */
>         alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
>                           max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
> 
> 
> On arm64 with 64K page size and transparent huge page, this gives an alignment
> of 512MB. This is quite restrictive and can eat up significant portions of
> memory on smaller memory targets. Adjusting the configuration options really
> isn't ideal for distributions that aim to have a single image which runs on
> all targets.
> 
> Approaches I've thought about:
> - Making CMA alignment less restrictive (and dealing with the fallout from
> the comment above)
> - Command line option to force a reasonable alignment
> 
> There's been some interest in other CMA topics so this might go along well.
> 
> Thanks,
> Laura
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-01-26 17:25 ` Michal Hocko
@ 2018-04-04  5:11   ` Joonsoo Kim
  2018-04-11 19:55     ` Laura Abbott
  0 siblings, 1 reply; 11+ messages in thread
From: Joonsoo Kim @ 2018-04-04  5:11 UTC (permalink / raw)
  To: Michal Hocko; +Cc: Laura Abbott, lsf-pc, linux-mm

Hello, Laura.
Sorry for a late response.


On Fri, Jan 26, 2018 at 06:25:27PM +0100, Michal Hocko wrote:
> [Ccing Joonsoo]

Thanks! Michal.

> 
> On Fri 26-01-18 02:08:14, Laura Abbott wrote:
> > CMA as it's currently designed requires alignment to the pageblock size c.f.
> > 
> >         /*
> >          * Sanitise input arguments.
> >          * Pages both ends in CMA area could be merged into adjacent unmovable
> >          * migratetype page by page allocator's buddy algorithm. In the case,
> >          * you couldn't get a contiguous memory, which is not what we want.
> >          */
> >         alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
> >                           max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
> > 
> > 
> > On arm64 with 64K page size and transparent huge page, this gives an alignment
> > of 512MB. This is quite restrictive and can eat up significant portions of
> > memory on smaller memory targets. Adjusting the configuration options really
> > isn't ideal for distributions that aim to have a single image which runs on
> > all targets.
> > 
> > Approaches I've thought about:
> > - Making CMA alignment less restrictive (and dealing with the fallout from
> > the comment above)
> > - Command line option to force a reasonable alignment

If the patchset 'manage the memory of the CMA area by using the ZONE_MOVABLE' is
merged, this restriction can be removed since there is no unmovable
pageblock in ZONE_MOVABLE. Just quick thought. :)

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-04  5:11   ` Joonsoo Kim
@ 2018-04-11 19:55     ` Laura Abbott
  2018-04-11 20:02       ` Vlastimil Babka
  0 siblings, 1 reply; 11+ messages in thread
From: Laura Abbott @ 2018-04-11 19:55 UTC (permalink / raw)
  To: Joonsoo Kim, Michal Hocko; +Cc: lsf-pc, linux-mm

On 04/03/2018 10:11 PM, Joonsoo Kim wrote:
> Hello, Laura.
> Sorry for a late response.
> 
> 
> On Fri, Jan 26, 2018 at 06:25:27PM +0100, Michal Hocko wrote:
>> [Ccing Joonsoo]
> 
> Thanks! Michal.
> 
>>
>> On Fri 26-01-18 02:08:14, Laura Abbott wrote:
>>> CMA as it's currently designed requires alignment to the pageblock size c.f.
>>>
>>>          /*
>>>           * Sanitise input arguments.
>>>           * Pages both ends in CMA area could be merged into adjacent unmovable
>>>           * migratetype page by page allocator's buddy algorithm. In the case,
>>>           * you couldn't get a contiguous memory, which is not what we want.
>>>           */
>>>          alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
>>>                            max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
>>>
>>>
>>> On arm64 with 64K page size and transparent huge page, this gives an alignment
>>> of 512MB. This is quite restrictive and can eat up significant portions of
>>> memory on smaller memory targets. Adjusting the configuration options really
>>> isn't ideal for distributions that aim to have a single image which runs on
>>> all targets.
>>>
>>> Approaches I've thought about:
>>> - Making CMA alignment less restrictive (and dealing with the fallout from
>>> the comment above)
>>> - Command line option to force a reasonable alignment
> 
> If the patchset 'manage the memory of the CMA area by using the ZONE_MOVABLE' is
> merged, this restriction can be removed since there is no unmovable
> pageblock in ZONE_MOVABLE. Just quick thought. :)
> 
> Thanks.
> 

Thanks for that pointer. What's the current status of that patchset? Was that
one that needed more review/testing?

Thanks,
Laura

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-11 19:55     ` Laura Abbott
@ 2018-04-11 20:02       ` Vlastimil Babka
  2018-04-12  1:06         ` Laura Abbott
  0 siblings, 1 reply; 11+ messages in thread
From: Vlastimil Babka @ 2018-04-11 20:02 UTC (permalink / raw)
  To: Laura Abbott, Joonsoo Kim, Michal Hocko; +Cc: lsf-pc, linux-mm

On 04/11/2018 09:55 PM, Laura Abbott wrote:
> On 04/03/2018 10:11 PM, Joonsoo Kim wrote:
>> If the patchset 'manage the memory of the CMA area by using the ZONE_MOVABLE' is
>> merged, this restriction can be removed since there is no unmovable
>> pageblock in ZONE_MOVABLE. Just quick thought. :)
>>
>> Thanks.
>>
> 
> Thanks for that pointer. What's the current status of that patchset? Was that
> one that needed more review/testing?

It was merged by Linus today, see around commit bad8c6c0b114 ("mm/cma:
manage the memory of the CMA area by using the ZONE_MOVABLE")

Congrats, Joonsoo :)

> Thanks,
> Laura
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-11 20:02       ` Vlastimil Babka
@ 2018-04-12  1:06         ` Laura Abbott
  2018-04-12  5:51           ` Michal Hocko
  0 siblings, 1 reply; 11+ messages in thread
From: Laura Abbott @ 2018-04-12  1:06 UTC (permalink / raw)
  To: Vlastimil Babka, Joonsoo Kim, Michal Hocko; +Cc: lsf-pc, linux-mm

On 04/11/2018 01:02 PM, Vlastimil Babka wrote:
> On 04/11/2018 09:55 PM, Laura Abbott wrote:
>> On 04/03/2018 10:11 PM, Joonsoo Kim wrote:
>>> If the patchset 'manage the memory of the CMA area by using the ZONE_MOVABLE' is
>>> merged, this restriction can be removed since there is no unmovable
>>> pageblock in ZONE_MOVABLE. Just quick thought. :)
>>>
>>> Thanks.
>>>
>>
>> Thanks for that pointer. What's the current status of that patchset? Was that
>> one that needed more review/testing?
> 
> It was merged by Linus today, see around commit bad8c6c0b114 ("mm/cma:
> manage the memory of the CMA area by using the ZONE_MOVABLE")
> 
> Congrats, Joonsoo :)
> 

I took a look at this a little bit more and while it's true we don't
have the unmovable restriction anymore, CMA is still tied to the pageblock
size (512MB) because we still have MIGRATE_CMA. I guess making the
pageblock smaller seems like the most plausible approach?

Thanks,
Laura

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-12  1:06         ` Laura Abbott
@ 2018-04-12  5:51           ` Michal Hocko
  2018-04-12  6:27             ` Vlastimil Babka
  0 siblings, 1 reply; 11+ messages in thread
From: Michal Hocko @ 2018-04-12  5:51 UTC (permalink / raw)
  To: Laura Abbott; +Cc: Vlastimil Babka, Joonsoo Kim, lsf-pc, linux-mm

On Wed 11-04-18 18:06:59, Laura Abbott wrote:
> On 04/11/2018 01:02 PM, Vlastimil Babka wrote:
> > On 04/11/2018 09:55 PM, Laura Abbott wrote:
> > > On 04/03/2018 10:11 PM, Joonsoo Kim wrote:
> > > > If the patchset 'manage the memory of the CMA area by using the ZONE_MOVABLE' is
> > > > merged, this restriction can be removed since there is no unmovable
> > > > pageblock in ZONE_MOVABLE. Just quick thought. :)
> > > > 
> > > > Thanks.
> > > > 
> > > 
> > > Thanks for that pointer. What's the current status of that patchset? Was that
> > > one that needed more review/testing?
> > 
> > It was merged by Linus today, see around commit bad8c6c0b114 ("mm/cma:
> > manage the memory of the CMA area by using the ZONE_MOVABLE")
> > 
> > Congrats, Joonsoo :)
> > 
> 
> I took a look at this a little bit more and while it's true we don't
> have the unmovable restriction anymore, CMA is still tied to the pageblock
> size (512MB) because we still have MIGRATE_CMA. I guess making the
> pageblock smaller seems like the most plausible approach?

Maybe I am wrong but my take on what Joonsoo said is that we really do
not have to care about page blocks and MIGRATE_CMA because GFP_MOVABLE
can be allocated from that migrate type as it is by definition movable.
The size of the page block shouldn't matter.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-12  5:51           ` Michal Hocko
@ 2018-04-12  6:27             ` Vlastimil Babka
  0 siblings, 0 replies; 11+ messages in thread
From: Vlastimil Babka @ 2018-04-12  6:27 UTC (permalink / raw)
  To: Michal Hocko, Laura Abbott; +Cc: Joonsoo Kim, lsf-pc, linux-mm

On 04/12/2018 07:51 AM, Michal Hocko wrote:
> On Wed 11-04-18 18:06:59, Laura Abbott wrote:
>>
>> I took a look at this a little bit more and while it's true we don't
>> have the unmovable restriction anymore, CMA is still tied to the pageblock
>> size (512MB) because we still have MIGRATE_CMA. I guess making the
>> pageblock smaller seems like the most plausible approach?
> 
> Maybe I am wrong but my take on what Joonsoo said is that we really do
> not have to care about page blocks and MIGRATE_CMA because GFP_MOVABLE
> can be allocated from that migrate type as it is by definition movable.
> The size of the page block shouldn't matter.

Agree, CMA itself doesn't need mark pageblocks with MIGRATE_CMA anymore.
The only user is now hardened usercopy via check_page_span() ->
is_migrate_cma_page(). If we could give up the CMA check there (or
recognize CMA differently?), MIGRATE_CMA could be removed completely,
together with the pageblock alignment code.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-01-26 10:08 [LSF/MM TOPIC] CMA and larger page sizes Laura Abbott
  2018-01-26 17:25 ` Michal Hocko
@ 2018-04-17 11:36 ` Michal Hocko
  2018-04-17 15:01   ` Laura Abbott
  1 sibling, 1 reply; 11+ messages in thread
From: Michal Hocko @ 2018-04-17 11:36 UTC (permalink / raw)
  To: Laura Abbott; +Cc: lsf-pc, linux-mm

On Fri 26-01-18 02:08:14, Laura Abbott wrote:
> CMA as it's currently designed requires alignment to the pageblock size c.f.
> 
>         /*
>          * Sanitise input arguments.
>          * Pages both ends in CMA area could be merged into adjacent unmovable
>          * migratetype page by page allocator's buddy algorithm. In the case,
>          * you couldn't get a contiguous memory, which is not what we want.
>          */
>         alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
>                           max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
> 
> 
> On arm64 with 64K page size and transparent huge page, this gives an alignment
> of 512MB. This is quite restrictive and can eat up significant portions of
> memory on smaller memory targets. Adjusting the configuration options really
> isn't ideal for distributions that aim to have a single image which runs on
> all targets.
> 
> Approaches I've thought about:
> - Making CMA alignment less restrictive (and dealing with the fallout from
> the comment above)
> - Command line option to force a reasonable alignment

Laura, are you still interested discussing this or other CMA related
topic?

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-17 11:36 ` Michal Hocko
@ 2018-04-17 15:01   ` Laura Abbott
  2018-04-18  8:17     ` Michal Hocko
  0 siblings, 1 reply; 11+ messages in thread
From: Laura Abbott @ 2018-04-17 15:01 UTC (permalink / raw)
  To: Michal Hocko; +Cc: lsf-pc, linux-mm

On 04/17/2018 04:36 AM, Michal Hocko wrote:
> On Fri 26-01-18 02:08:14, Laura Abbott wrote:
>> CMA as it's currently designed requires alignment to the pageblock size c.f.
>>
>>          /*
>>           * Sanitise input arguments.
>>           * Pages both ends in CMA area could be merged into adjacent unmovable
>>           * migratetype page by page allocator's buddy algorithm. In the case,
>>           * you couldn't get a contiguous memory, which is not what we want.
>>           */
>>          alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
>>                            max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
>>
>>
>> On arm64 with 64K page size and transparent huge page, this gives an alignment
>> of 512MB. This is quite restrictive and can eat up significant portions of
>> memory on smaller memory targets. Adjusting the configuration options really
>> isn't ideal for distributions that aim to have a single image which runs on
>> all targets.
>>
>> Approaches I've thought about:
>> - Making CMA alignment less restrictive (and dealing with the fallout from
>> the comment above)
>> - Command line option to force a reasonable alignment
> 
> Laura, are you still interested discussing this or other CMA related
> topic?
> 

In light of Joonsoo's patches, I don't think we need a lot of time
but I'd still like some chance to discuss. I think there was some
other interest in CMA topics so it can be combined with those if
they are happening as well.

Thanks,
Laura

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LSF/MM TOPIC] CMA and larger page sizes
  2018-04-17 15:01   ` Laura Abbott
@ 2018-04-18  8:17     ` Michal Hocko
  0 siblings, 0 replies; 11+ messages in thread
From: Michal Hocko @ 2018-04-18  8:17 UTC (permalink / raw)
  To: Laura Abbott; +Cc: lsf-pc, linux-mm

On Tue 17-04-18 08:01:53, Laura Abbott wrote:
> On 04/17/2018 04:36 AM, Michal Hocko wrote:
> > On Fri 26-01-18 02:08:14, Laura Abbott wrote:
> > > CMA as it's currently designed requires alignment to the pageblock size c.f.
> > > 
> > >          /*
> > >           * Sanitise input arguments.
> > >           * Pages both ends in CMA area could be merged into adjacent unmovable
> > >           * migratetype page by page allocator's buddy algorithm. In the case,
> > >           * you couldn't get a contiguous memory, which is not what we want.
> > >           */
> > >          alignment = max(alignment,  (phys_addr_t)PAGE_SIZE <<
> > >                            max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
> > > 
> > > 
> > > On arm64 with 64K page size and transparent huge page, this gives an alignment
> > > of 512MB. This is quite restrictive and can eat up significant portions of
> > > memory on smaller memory targets. Adjusting the configuration options really
> > > isn't ideal for distributions that aim to have a single image which runs on
> > > all targets.
> > > 
> > > Approaches I've thought about:
> > > - Making CMA alignment less restrictive (and dealing with the fallout from
> > > the comment above)
> > > - Command line option to force a reasonable alignment
> > 
> > Laura, are you still interested discussing this or other CMA related
> > topic?
> > 
> 
> In light of Joonsoo's patches, I don't think we need a lot of time
> but I'd still like some chance to discuss. I think there was some
> other interest in CMA topics so it can be combined with those if
> they are happening as well.

OK, so I've put a placeholder for a CMA discussion. You have won the
lead on that session ;) We can change that later of course.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-04-18  8:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 10:08 [LSF/MM TOPIC] CMA and larger page sizes Laura Abbott
2018-01-26 17:25 ` Michal Hocko
2018-04-04  5:11   ` Joonsoo Kim
2018-04-11 19:55     ` Laura Abbott
2018-04-11 20:02       ` Vlastimil Babka
2018-04-12  1:06         ` Laura Abbott
2018-04-12  5:51           ` Michal Hocko
2018-04-12  6:27             ` Vlastimil Babka
2018-04-17 11:36 ` Michal Hocko
2018-04-17 15:01   ` Laura Abbott
2018-04-18  8:17     ` Michal Hocko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.