The patch titled Subject: maple_tree: use mas_node_count_gfp() in mas_expected_entries() has been added to the -mm mm-hotfixes-unstable branch. Its filename is maple_tree-use-mas_node_count_gfp-on-mas_expected_entries.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-use-mas_node_count_gfp-on-mas_expected_entries.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Jaeseon Sim <jason.sim@xxxxxxxxxxx> Subject: maple_tree: use mas_node_count_gfp() in mas_expected_entries() Date: Fri, 15 Sep 2023 18:32:43 +0900 Use mas_node_count_gfp with GFP_KERNEL instead of GFP_NOWAIT | __GFP_NOWARN on mas_expected_entries in order to allow memory reclaim. Currently, fork errors occur on low free memory as follows: Zygote : Failed to fork child process: Out of memory (12) -ENOMEM was returned as following path: mas_node_count mas_expected_entries dup_mmap dup_mm copy_mm copy_process Link: https://lkml.kernel.org/r/20230915093243epcms1p46fa00bbac1ab7b7dca94acb66c44c456@epcms1p4 Signed-off-by: Jaeseon Sim <jason.sim@xxxxxxxxxxx> Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/maple_tree.c~maple_tree-use-mas_node_count_gfp-on-mas_expected_entries +++ a/lib/maple_tree.c @@ -5574,7 +5574,7 @@ int mas_expected_entries(struct ma_state /* Internal nodes */ nr_nodes += DIV_ROUND_UP(nr_nodes, nonleaf_cap); /* Add working room for split (2 nodes) + new parents */ - mas_node_count(mas, nr_nodes + 3); + mas_node_count_gfp(mas, nr_nodes + 3, GFP_KERNEL); /* Detect if allocations run out */ mas->mas_flags |= MA_STATE_PREALLOC; _ Patches currently in -mm which might be from jason.sim@xxxxxxxxxxx are maple_tree-use-mas_node_count_gfp-on-mas_expected_entries.patch