The patch titled Subject: mm/util.c: add warning if __vm_enough_memory fails has been added to the -mm mm-unstable branch. Its filename is mm-add-warning-if-__vm_enough_memory-fails.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-add-warning-if-__vm_enough_memory-fails.patch This patch will later appear in the mm-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: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Subject: mm/util.c: add warning if __vm_enough_memory fails Date: Tue, 26 Jul 2022 22:54:28 +0800 If a process has not enough memory to allocate a new virtual mapping, we may meet verious kinds of error, eg, fork cannot allocate memory, SIGBUS error in shmem, but it is difficult to confirm them, let's add some debug information to easily to check this scenario if __vm_enough_memory fails. Link: https://lkml.kernel.org/r/20220726145428.8030-1-wangkefeng.wang@xxxxxxxxxx Reported-by: Yongqiang Liu <liuyongqiang13@xxxxxxxxxx> Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/util.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/util.c~mm-add-warning-if-__vm_enough_memory-fails +++ a/mm/util.c @@ -1052,6 +1052,8 @@ int __vm_enough_memory(struct mm_struct if (percpu_counter_read_positive(&vm_committed_as) < allowed) return 0; error: + pr_warn_ratelimited("%s: pid: %d, comm: %s, no enough memory for the allocation\n", + __func__, current->pid, current->comm); vm_unacct_memory(pages); return -ENOMEM; _ Patches currently in -mm which might be from wangkefeng.wang@xxxxxxxxxx are mm-memory-failure-cleanup-try_to_split_thp_page.patch mm-add-warning-if-__vm_enough_memory-fails.patch