From: Andrew Morton <akpm@linux-foundation.org>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: Rui Qi <qirui.001@bytedance.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <nao.horiguchi@gmail.com>
Subject: Re: [PATCH] mm/memory-failure: allow memory allocation from emergency reserves
Date: Tue, 2 Jul 2024 00:19:40 -0700 [thread overview]
Message-ID: <20240702001940.43a9447a76b51a871d8dec97@linux-foundation.org> (raw)
In-Reply-To: <d7fb45a9-2d16-a2d5-59f4-f1e7a4362e33@huawei.com>
On Sat, 29 Jun 2024 10:09:46 +0800 Miaohe Lin <linmiaohe@huawei.com> wrote:
> On 2024/6/25 10:23, Rui Qi wrote:
> > From: Rui Qi <qirui.001@bytedance.com>
> >
> > we hope that memory errors can be successfully handled quickly, using
> > __GFP_MEMALLOC can help us improve the success rate of processing
>
> Comments of __GFP_MEMALLOC says:
>
> * Users of this flag have to be extremely careful to not deplete the reserve
> * completely and implement a throttling mechanism which controls the
> * consumption of the reserve based on the amount of freed memory.
>
> It seems there's no such throttling mechanism in memory_failure.
>
> > under memory pressure, because to_kill struct is freed very quickly,
> > so using __GFP_MEMALLOC will not exacerbate memory pressure for a long time,
> > and more memory will be freed after killed task exiting, which will also
>
> Tasks might not be killed even to_kill struct is allocated.
>
> ...
>
> > - raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC);
> > + raw_hwp = kmalloc(sizeof(struct raw_hwp_page), GFP_ATOMIC | __GFP_MEMALLOC);
>
> In already hardware poisoned code path, raw_hwp can be allocated to store raw page info
> without killing anything. So __GFP_MEMALLOC might not be suitable to use.
> Or am I miss something?
Yes, I'm doubtful about this patch. I think that rather than poking at a
particular implementation, it would be helpful for us to see a complete
description of the issues which were observed, please. Let's see the
bug report and we can discuss fixes later.
next prev parent reply other threads:[~2024-07-02 7:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 2:23 [PATCH] mm/memory-failure: allow memory allocation from emergency reserves Rui Qi
2024-06-25 20:01 ` Andrew Morton
2024-06-29 2:09 ` Miaohe Lin
2024-07-02 7:19 ` Andrew Morton [this message]
2024-07-02 8:04 ` Miaohe Lin
2024-07-04 23:26 ` Andrew Morton
2024-07-05 1:04 ` Miaohe Lin
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=20240702001940.43a9447a76b51a871d8dec97@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=qirui.001@bytedance.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;
as well as URLs for NNTP newsgroup(s).