From: Matthew Wilcox <willy@infradead.org>
To: Xu Huijie <xuhuijie2@huawei.com>
Cc: linux-mm@kvack.org, wuxu.wu@huawei.com
Subject: Re: [PATCH] add kernel log when allocate a new virtual mapping failed because of overcommit
Date: Wed, 30 Jun 2021 14:29:55 +0100 [thread overview]
Message-ID: <YNxx0+A0F+PRoQcf@casper.infradead.org> (raw)
In-Reply-To: <20210630074433.41992-1-xuhuijie2@huawei.com>
On Wed, Jun 30, 2021 at 03:44:33PM +0800, Xu Huijie wrote:
> From: xuhuijie <xuhuijie2@huawei.com>
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index aa9de981b..f019fc6b2 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -1758,8 +1758,10 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
> */
> if (accountable_mapping(file, vm_flags)) {
> charged = len >> PAGE_SHIFT;
> - if (security_vm_enough_memory_mm(mm, charged))
> + if (security_vm_enough_memory_mm(mm, charged)) {
> + pr_err("Unable to allocate a new virtual mapping because of the overcommit\n");
No, we don't let unprivileged processes flood the kernel logs. If this
is genuinely useful, something like pr_info_ratelimited() might be
appropriate. It certainly doesn't rise to the level of "error".
prev parent reply other threads:[~2021-06-30 13:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 7:44 Xu Huijie
2021-06-30 13:29 ` Matthew Wilcox [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YNxx0+A0F+PRoQcf@casper.infradead.org \
--to=willy@infradead.org \
--cc=linux-mm@kvack.org \
--cc=wuxu.wu@huawei.com \
--cc=xuhuijie2@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox