Commit ca5d467
committed
mm/page_alloc: ensure try_alloc_pages() plays well with unaccepted memory
JIRA: https://issues.redhat.com/browse/RHEL-78202
commit 23fa022
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Date: Tue May 6 14:25:08 2025 +0300
mm/page_alloc: ensure try_alloc_pages() plays well with unaccepted memory
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.
Found via code inspection - only BPF uses this at present and the
runtime effects are unclear.
Link: https://lkml.kernel.org/r/20250506112509.905147-2-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fixes: 97769a5 ("mm, bpf: Introduce try_alloc_pages() for opportunistic page allocation")
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Gregory Bell <grbell@redhat.com>1 parent 9c44f82 commit ca5d467
1 file changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| |||
3464 | 3465 | | |
3465 | 3466 | | |
3466 | 3467 | | |
3467 | | - | |
| 3468 | + | |
3468 | 3469 | | |
3469 | 3470 | | |
3470 | 3471 | | |
| |||
3491 | 3492 | | |
3492 | 3493 | | |
3493 | 3494 | | |
3494 | | - | |
| 3495 | + | |
3495 | 3496 | | |
3496 | 3497 | | |
3497 | 3498 | | |
| |||
3544 | 3545 | | |
3545 | 3546 | | |
3546 | 3547 | | |
3547 | | - | |
| 3548 | + | |
3548 | 3549 | | |
3549 | 3550 | | |
3550 | 3551 | | |
| |||
4688 | 4689 | | |
4689 | 4690 | | |
4690 | 4691 | | |
4691 | | - | |
| 4692 | + | |
4692 | 4693 | | |
4693 | 4694 | | |
4694 | 4695 | | |
| |||
4697 | 4698 | | |
4698 | 4699 | | |
4699 | 4700 | | |
4700 | | - | |
| 4701 | + | |
4701 | 4702 | | |
4702 | 4703 | | |
4703 | 4704 | | |
| |||
7063 | 7064 | | |
7064 | 7065 | | |
7065 | 7066 | | |
7066 | | - | |
| 7067 | + | |
| 7068 | + | |
7067 | 7069 | | |
7068 | 7070 | | |
7069 | 7071 | | |
| |||
7074 | 7076 | | |
7075 | 7077 | | |
7076 | 7078 | | |
| 7079 | + | |
| 7080 | + | |
| 7081 | + | |
| 7082 | + | |
7077 | 7083 | | |
7078 | 7084 | | |
7079 | 7085 | | |
| |||
7130 | 7136 | | |
7131 | 7137 | | |
7132 | 7138 | | |
7133 | | - | |
| 7139 | + | |
| 7140 | + | |
7134 | 7141 | | |
7135 | 7142 | | |
7136 | 7143 | | |
| |||
7201 | 7208 | | |
7202 | 7209 | | |
7203 | 7210 | | |
7204 | | - | |
7205 | | - | |
7206 | | - | |
7207 | | - | |
7208 | | - | |
7209 | 7211 | | |
7210 | 7212 | | |
7211 | 7213 | | |
| |||
0 commit comments