[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <pvznson4tlwz4tavawlcotqouooemysjlv46mclo4hs3hyr43d@ek4cav7m4nrp>
Date: Wed, 7 May 2025 14:31:19 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: vbabka@...e.cz, surenb@...gle.com, mhocko@...e.com,
jackmanb@...gle.com, hannes@...xchg.org, bp@...en8.de, tglx@...utronix.de,
david@...hat.com, ast@...nel.org, linux-mm@...ck.org, linux-coco@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] mm/page_alloc: Ensure try_alloc_pages() plays well
with unaccepted memory
On Tue, May 06, 2025 at 05:00:34PM -0700, Andrew Morton wrote:
> On Tue, 6 May 2025 14:25:08 +0300 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com> wrote:
>
> > try_alloc_pages() will not attempt to allocate memory if the system has
> > *any* unaccepted memory. Memory is accepted as needed and can remain in
> > the system indefinitely, causing the interface to always fail.
> >
> > Rather than immediately giving up, attempt to use already accepted
> > memory on free lists.
> >
> > Pass 'alloc_flags' to cond_accept_memory() and do not accept new memory
> > for ALLOC_TRYLOCK requests.
>
> What are the userspace-visible effects, please?
I cannot say I fully understand the implications.
The interface obviously allows failure, but the caller might expect
eventual success on retry.
So far, only BPF uses the interface. Maybe Alexei can comment on what will
happen if the function always fails.
I noticed the issue by code analysis because the second patch removes
has_unaccepted_memory().
> Was the omission of cc:stable intentional? I cannot locally determine
> this without the above info.
>
> If the cc:stable omission was indeed intentional then it would be better
> if this series was presented as two standalone patches.
Given that the second patch cannot be applied to current Linus' tree
without this one, it is better to add stable@.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists