* [PATCH v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO
@ 2023-04-06 8:20 Naoya Horiguchi
2023-04-06 22:57 ` Yang Shi
0 siblings, 1 reply; 2+ messages in thread
From: Naoya Horiguchi @ 2023-04-06 8:20 UTC (permalink / raw)
To: Andrew Morton
Cc: Yang Shi, Miaohe Lin, Xu Yu, Tetsuo Handa, Naoya Horiguchi,
linux-mm, linux-kernel
From: Naoya Horiguchi <naoya.horiguchi@nec.com>
split_huge_page_to_list() WARNs when called for huge zero pages, which
sounds to me too harsh because it does not imply a kernel bug, but just
notifies the event to admins. On the other hand, this is considered
as critical by syzkaller and makes its testing less efficient, which
seems to me harmful.
So replace the VM_WARN_ON_ONCE_FOLIO with pr_warn_ratelimited.
Fixes: 478d134e9506 ("mm/huge_memory: do not overkill when splitting huge_zero_page")
Reported-by: syzbot+07a218429c8d19b1fb25@syzkaller.appspotmail.com
Link: https://lore.kernel.org/lkml/000000000000a6f34a05e6efcd01@google.com/
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: stable@vger.kernel.org
---
mm/huge_memory.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 81a5689806af..06bcdd6f5060 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2649,9 +2649,10 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
is_hzp = is_huge_zero_page(&folio->page);
- VM_WARN_ON_ONCE_FOLIO(is_hzp, folio);
- if (is_hzp)
+ if (is_hzp) {
+ pr_warn_ratelimited("Called split_huge_page for huge zero page\n");
return -EBUSY;
+ }
if (folio_test_writeback(folio))
return -EBUSY;
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO
2023-04-06 8:20 [PATCH v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO Naoya Horiguchi
@ 2023-04-06 22:57 ` Yang Shi
0 siblings, 0 replies; 2+ messages in thread
From: Yang Shi @ 2023-04-06 22:57 UTC (permalink / raw)
To: Naoya Horiguchi
Cc: Andrew Morton, Miaohe Lin, Xu Yu, Tetsuo Handa, Naoya Horiguchi,
linux-mm, linux-kernel
On Thu, Apr 6, 2023 at 1:20 AM Naoya Horiguchi
<naoya.horiguchi@linux.dev> wrote:
>
> From: Naoya Horiguchi <naoya.horiguchi@nec.com>
>
> split_huge_page_to_list() WARNs when called for huge zero pages, which
> sounds to me too harsh because it does not imply a kernel bug, but just
> notifies the event to admins. On the other hand, this is considered
> as critical by syzkaller and makes its testing less efficient, which
> seems to me harmful.
>
> So replace the VM_WARN_ON_ONCE_FOLIO with pr_warn_ratelimited.
Makes sense to me. Reviewed-by: Yang Shi <shy828301@gmail.com>
>
> Fixes: 478d134e9506 ("mm/huge_memory: do not overkill when splitting huge_zero_page")
> Reported-by: syzbot+07a218429c8d19b1fb25@syzkaller.appspotmail.com
> Link: https://lore.kernel.org/lkml/000000000000a6f34a05e6efcd01@google.com/
> Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
> Cc: stable@vger.kernel.org
> ---
> mm/huge_memory.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 81a5689806af..06bcdd6f5060 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2649,9 +2649,10 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
> VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
>
> is_hzp = is_huge_zero_page(&folio->page);
> - VM_WARN_ON_ONCE_FOLIO(is_hzp, folio);
> - if (is_hzp)
> + if (is_hzp) {
> + pr_warn_ratelimited("Called split_huge_page for huge zero page\n");
> return -EBUSY;
> + }
>
> if (folio_test_writeback(folio))
> return -EBUSY;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-06 22:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 8:20 [PATCH v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO Naoya Horiguchi
2023-04-06 22:57 ` Yang Shi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox