From patchwork Thu Apr 6 08:20:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 13202991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0944C76196 for ; Thu, 6 Apr 2023 08:20:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6425A6B0074; Thu, 6 Apr 2023 04:20:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6194B6B0075; Thu, 6 Apr 2023 04:20:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52F5E6B0078; Thu, 6 Apr 2023 04:20:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 493CE6B0074 for ; Thu, 6 Apr 2023 04:20:39 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1CFD61605B4 for ; Thu, 6 Apr 2023 08:20:39 +0000 (UTC) X-FDA: 80650269798.06.F597CEE Received: from out-59.mta1.migadu.com (out-59.mta1.migadu.com [95.215.58.59]) by imf19.hostedemail.com (Postfix) with ESMTP id A863E1A0015 for ; Thu, 6 Apr 2023 08:20:36 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Qn0MScj3; spf=pass (imf19.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 95.215.58.59 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680769236; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=UFsqLHECiaaZpUWd/R1g+L87eavPw4icy8tzwp+ivws=; b=6N7jt2FcfOd35jUDpe9QNv0fQGZw7bHNIYLxfvhcH+HSdoqv1AjutFvL7Sn81+wa5TXcer kLObJWQWZiBWvEg14wr8d5LJNPMpa9rF+5pcYDE7XFI6tKjOlgatAV9Hqq+beCu3awmPFB klcg1INMoRzecyCjhcHn8iHOwe64tv4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Qn0MScj3; spf=pass (imf19.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 95.215.58.59 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680769236; a=rsa-sha256; cv=none; b=fXVjtNrIbCt5pI/MWoxGaIOSRyjf5vSW53IaBqr9elvqGBNG5XOEvefpFpGCT+Y3+WBfgc jFJU/QBMH/Qsq/jQyRt/zPYS6pnMprCVaccIhp/Bz1hk5qVLhXZx+eew/qLx7gjhTMWNUv p1mWrxXME8A7w1BbUHXNhtua1NHmdhk= 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 To: Andrew Morton Cc: Yang Shi , Miaohe Lin , Xu Yu , Tetsuo Handa , Naoya Horiguchi , 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 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A863E1A0015 X-Rspam-User: X-Stat-Signature: gubgobqa645b55kzgpqm6zd8offkch7t X-HE-Tag: 1680769236-119830 X-HE-Meta: U2FsdGVkX19wJaK48Q9LzyZaLxf0RJ5SE5JFidBEcRbn0yhLSISim8K/AafAm+gSaA5vpoYHTqC+8lvyByvSJ5wvSoiQf3Bw3tsjtdmgiUGtg4a9EXnVVgzZvCvsWlrWIK15QZj9JHs0GoieUe+qafckRNnUchrVhDC4Xgti6+dI3IctDXdNQf+aiHj2O31GkrPwidf0dBVV1XBLzs8adpJY/0bWLVBWnl5b+2Nz39gflBA4jtkmOqNyvUT+kTBlW0+diaVOWs/B7sw7tlzjvR0cdUeGtXuaL/SkqRtLAJRYkLTepQUKf7u7gHaNEhjN7P+BkPzdlQlPHoY1KUuj818N206F2qC7Gx2PJZZywHgvw57rIBHfv3Xq2SC2dcXID0QGNexioH2Ezi0Wk0eBIKTw7XCPgwS1uE1g+gBU5xeDe5n2iA76p1xP/DNAleg20W+tEifSdKbJUgh/BehFKyDq+TrkaBsHhnhovE48Mc6+FDl0yT/LnRXxSt+jI7gJnXfUIv0upqzueqYYZgWD9u+4HlcQBmMq4cpho2yvYN5osTnsGfm8WpHBO8+ozvsckdiHacc94BRcziIxEcFLnVKHeE4xquNDaZEvNSUaGhe/iGBqLuuF/LJ4Xc7ixiza/+GMYiBy/Ozc3AdPAHm8yHl6JIVPNhOTHyAq10knFR5qAE5zq/6/v4CcNuw8CEm4oqqvCzuJ6L9kMspxBABZmIwaW4DOnv/oL7R4iKGurJTX2QO5O6CZexsKnnZ1JRBM63/99LXN57upjkrecB96cUIgMMMXwvJbAgsl/HdAJ9hoOxkikNDs2lMnViIkO1QrrRNPQ/PUoeOT7phSk5m8RO9yk6mgdAIqzEK3l2Nf59Ve+34Nfi1VxEWBlf5DUAUN1Nihz8hijKU+1vJNbSyAJOgre4a4SM9CBFZiRgU/yZ5JBesgzINRY760Eo+WjZ71LkcwnV5dqQ0JYMoC81y 0DDzvzrQ bT90gy0GoB+hmsr+0N8Q9zNL4QrbH7msT50ujIPoiWyhRQ1WV712LiO3XBEZWNiFXmtu3ktWT3HDWLUJALXLr3z+xvpw2FIf9cC4j32zec3OKDf4h0EnfSWa4AD882yrnp/zA52vijJuwdS8veF7adOdXvqdCM3cmnFvS6mGJjjb20gsskOigzkpNteZdHTgEu9qhsTlRuteFpV34XIuzlEIPdlIfx5rZbMnA3KXrdjMv00uI+XERnnLgZS7oLKmuLL3JJXFxuibdMxsFSBFHd4oUjT+7O9Nur6Wan9Y4MFdYcuKKjB5baLwXdw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Naoya Horiguchi 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 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;