[v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO
Message ID | 20230406082004.2185420-1-naoya.horiguchi@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp865031vqo; Thu, 6 Apr 2023 01:34:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJ/ESZYa9ouGcs9LMPYwhXcLzk4a9oopTxT8DWcHX6Bqd5CGKuW6o/BCUsZ60GDTQvLAi6 X-Received: by 2002:a17:906:110d:b0:889:1eb1:7517 with SMTP id h13-20020a170906110d00b008891eb17517mr5209098eja.30.1680770067910; Thu, 06 Apr 2023 01:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680770067; cv=none; d=google.com; s=arc-20160816; b=yBqWyXmteTYZ+xrzFEOdazduWHIzyRjkvgWsnEkPD0aXVrFkp5lWWkiMm+PwT9DV3z 2GnbapdxyR1NZYj4HwYO7sKqs3E4Vm3cWC4CC48JHfZUN/Ozpx3APZYHHPv+IhDegBX4 pIDdBNFNBYHL68RETIMwzQAXumVcuF8/2AW4ZoAgH+500tMcsP6l2hlvNv+Mddj5PQ5i 2NALyEWIVVpAiEENJBFMsmuAdqbpAC1rVtXGP21ddeHz5K+pwkYHuxXAO/hEi9MwLNA4 yZLwuslGAT+izW1oB5nZBCZJ0fXkCE1fI0AXZFbar1PAHcZS+aSOgr7v+J9tV5awIM0Z LYHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UFsqLHECiaaZpUWd/R1g+L87eavPw4icy8tzwp+ivws=; b=JQqXqsY5rUqNCpc8dticLXTgmEL4z9JweOcorW64wprXuYa/ovCGYnVlLfSMgo+zNQ ZdVp41SyvVJdS8pQxx9AvQxB6WGEqu75ODooULcxrW6dXvZ15TEDz3L1NpJNNomLp0gE 900qBWO94046nTSoYKV1NeaWweQbWNdF66DiIlJek/njeb4QwjSmltrchUbmC45wWEAe A+isga1DmidnKOvw4QcBlz1u8dUmSnuSC/tXoa+9xGu9DVioPR76tYhT4mie94B9XyRn rlBgGegX2JVCMdWG4dCuR/1hTjn7qFZqjFJHTQS1YRoZ1+BJsm6T/36VrqvKzOf+37B6 VYpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Qn0MScj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a17090603c300b008d7a24d918csi653247eja.823.2023.04.06.01.34.03; Thu, 06 Apr 2023 01:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Qn0MScj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236156AbjDFI3W (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Thu, 6 Apr 2023 04:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236019AbjDFI3U (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Apr 2023 04:29:20 -0400 X-Greylist: delayed 523 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 06 Apr 2023 01:29:18 PDT Received: from out-49.mta1.migadu.com (out-49.mta1.migadu.com [IPv6:2001:41d0:203:375::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E685E130 for <linux-kernel@vger.kernel.org>; Thu, 6 Apr 2023 01:29:18 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680769233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UFsqLHECiaaZpUWd/R1g+L87eavPw4icy8tzwp+ivws=; b=Qn0MScj3Ee2BYVFqPVQ+cea8TMWj0zA5FdtSZ9gpPTlV5MwLSd93kH70ti9md/zUXKNDns 3DZx+Y26sQJscgVZPN0NygmL/3LueEXL1LYTgG9t5OWRo/LywTC7UDRM9O+Vx8FCzvc17u CFCziuqW4+tPLRyYVHFH7QuAX5dBwLg= From: Naoya Horiguchi <naoya.horiguchi@linux.dev> To: Andrew Morton <akpm@linux-foundation.org> Cc: Yang Shi <shy828301@gmail.com>, Miaohe Lin <linmiaohe@huawei.com>, Xu Yu <xuyu@linux.alibaba.com>, Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, Naoya Horiguchi <naoya.horiguchi@nec.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO Date: Thu, 6 Apr 2023 17:20:04 +0900 Message-Id: <20230406082004.2185420-1-naoya.horiguchi@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762415154690017046?= X-GMAIL-MSGID: =?utf-8?q?1762415154690017046?= |
Series |
[v1] mm/huge_memory.c: warn with pr_warn_ratelimited instead of VM_WARN_ON_ONCE_FOLIO
|
|
Commit Message
Naoya Horiguchi
April 6, 2023, 8:20 a.m. UTC
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(-)
Comments
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 >
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;