[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <abe62159-c218-2fb5-e096-3c71c10c28e1@huawei.com>
Date: Tue, 9 Aug 2022 16:32:46 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
CC: David Hildenbrand <david@...hat.com>,
Yongqiang Liu <liuyongqiang13@...wei.com>
Subject: Re: [PATCH v2] mm: add warning if __vm_enough_memory fails
Hi maintainer, any comments, thanks
On 2022/7/26 22:54, Kefeng Wang wrote:
> If a process has no enough memory to allocate a new virtual mapping, we
> may meet 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 easy to check this scenario if __vm_enough_memory fails.
>
> Reported-by: Yongqiang Liu <liuyongqiang13@...wei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
> v2: use pr_warn_ratelimited, suggested by David Hildenbrand
>
> mm/util.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/util.c b/mm/util.c
> index 1266a33a49ea..c786e21c6051 100644
> --- a/mm/util.c
> +++ b/mm/util.c
> @@ -1020,6 +1020,8 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
> 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;
Powered by blists - more mailing lists