Re: [PATCH v2] mm: hugetlb_vmemmap: provide stronger vmemmap allocation guarantees

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 12, 2023 at 4:13 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Lots of questions (ie, missing information!)
>
> On Wed, 12 Apr 2023 19:59:39 +0000 Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> wrote:
>
> > HugeTLB pages have a struct page optimizations where struct pages for tail
> > pages are freed. However, when HugeTLB pages are destroyed, the memory for
> > struct pages (vmemmap) need to be allocated again.
> >
> > Currently, __GFP_NORETRY flag is used to allocate the memory for vmemmap,
> > but given that this flag makes very little effort to actually reclaim
> > memory the returning of huge pages back to the system can be problem.
>
> Are there any reports of this happening in the real world?
>
> > Lets
> > use __GFP_RETRY_MAYFAIL instead. This flag is also performs graceful
> > reclaim without causing ooms, but at least it may perform a few retries,
> > and will fail only when there is genuinely little amount of unused memory
> > in the system.
>
> If so, does this change help?

It helps to avoid transient allocation problems. In general it is not
a good idea to fail because we are trying to free gigantic pages back
to the system.

>
> If the allocation attempt fails, what are the consequences?

The gigantic page is not going to be returned to the system. The use
will have to free some memory before returning them back to the
system.

>
> What are the potential downsides to this change?  Why did we choose
> __GFP_NORETRY in the first place?
>
> What happens if we try harder (eg, GFP_KERNEL)?

MIchal answered this question, that it won't do much difference due to
__GFP_THISNODE





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux