{"id":2227066,"url":"http://patchwork.ozlabs.org/api/covers/2227066/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20260423071911.1962859-1-songmuchun@bytedance.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<20260423071911.1962859-1-songmuchun@bytedance.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20260423071911.1962859-1-songmuchun@bytedance.com/","date":"2026-04-23T07:19:05","name":"[v5,0/6] mm: fix vmemmap optimization accounting and initialization","submitter":{"id":78930,"url":"http://patchwork.ozlabs.org/api/people/78930/?format=json","name":"Muchun Song","email":"songmuchun@bytedance.com"},"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/cover/20260423071911.1962859-1-songmuchun@bytedance.com/mbox/","series":[{"id":501152,"url":"http://patchwork.ozlabs.org/api/series/501152/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=501152","date":"2026-04-23T07:19:05","name":"mm: fix vmemmap optimization accounting and initialization","version":5,"mbox":"http://patchwork.ozlabs.org/series/501152/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2227066/comments/","headers":{"Return-Path":"\n <linuxppc-dev+bounces-19992-incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=l2bCuTvi;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19992-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::1035\"","lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com","lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=l2bCuTvi;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com\n (client-ip=2607:f8b0:4864:20::1035; helo=mail-pj1-x1035.google.com;\n envelope-from=songmuchun@bytedance.com; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1 raw public key)\n server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g1SC639w6z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 17:19:28 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g1SC36Xptz2xm3;\n\tThu, 23 Apr 2026 17:19:27 +1000 (AEST)","from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com\n [IPv6:2607:f8b0:4864:20::1035])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4g1SC14dvFz2xSN\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 23 Apr 2026 17:19:24 +1000 (AEST)","by mail-pj1-x1035.google.com with SMTP id\n 98e67ed59e1d1-35fc2b18363so7124995a91.0\n        for <linuxppc-dev@lists.ozlabs.org>;\n Thu, 23 Apr 2026 00:19:24 -0700 (PDT)","from n232-176-004.byted.org ([36.110.163.97])\n        by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-3613fbd970fsm7092372a91.14.2026.04.23.00.19.16\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 23 Apr 2026 00:19:20 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776928767;\n\tcv=none;\n b=KJSrwM833uH7NT7kITIYTZq9nJzUefFuaAbXKKkAY7rIpspcqE2qvoQEg52YSLrERKnxk6j1qwd1b+eNP1UigCI0uU7rK3ySW+Akpjual3zAWjGRymAJJK+kD6kQkbDDWs3xgDfc86xuEFggBZy8Af12vvIELswXNuoXPnkLKn05JgpOBPV+WXTp+TWlkjCkErRNBP3BBgKG5i63vlqU8XCNy5ODtPy9vZe1K1G5Xx6xITx9rYU3+3YZERXqMYdlUKSfREFJQV5VF0nCdpU8mEQrTtz+QC+U9ttDjhPR6eid8j+WJa3WHHjrmw4G3L4ILbYP1bglLergGKdwzE+3uQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1776928767; c=relaxed/relaxed;\n\tbh=b5ucw1jsaiC+LU7Zn1moEYy2AT2i3WtwhP+YNxCDsCQ=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=ADc0IYZc9MMla5lmEWbmvVBUwYo3zoCvNMcEw8BN3215YHEfVg/oEw15fIcweicwc6Y0Lne7ROZLb8hm+XBCa5280LCFDOzIEXCeF7CD+d11UFKpxvz/UHn50SDv/96rJ6j1OMl5ENql5OEKAuJcWcP3d2uC+GA/dxZpWkWRrCd4E3Ry3rZTwXRBuoYk8WqT+4AhhsLIM6rWvkOLG2sroGf6Kl1bWqIGCLjQ6MySZi8E1QK9ON5BvPKwYsHrHwGcjBPji6S20iwcGkRHP4eQ8vZA4Xc/R789fT0K2yJT+b14PT9itPJcx6joMu5wAYtaeJ7qvjlFm3G6DCleQwnbmg==","ARC-Authentication-Results":"i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=l2bCuTvi; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::1035; helo=mail-pj1-x1035.google.com;\n envelope-from=songmuchun@bytedance.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=bytedance.com","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=bytedance.com; s=google; t=1776928761; x=1777533561;\n darn=lists.ozlabs.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=b5ucw1jsaiC+LU7Zn1moEYy2AT2i3WtwhP+YNxCDsCQ=;\n        b=l2bCuTviSkwS8hYpIPV/wwZnWwEq01TcxoFbmTVeZHQfxnNfBDshpWfKpepd+hGrxO\n         /xNayfOtV45OhOa5KhgjOEPgItZ2KxHOpuly74gZxWovNQLMl/pY75CgtQ57nRU1BMD2\n         1ItAvqq16Ug37fEEfDB1jB7flfJg1xFhdk0t3VHEMh3yqEovH/UjA9gVfryKZ2mJFQGL\n         stVIJl9uyx1gxnZnWHTjWAPLdOh0sWrckrEmQzxYsafPK9q8u7RLoLIUiLUHLgReK6+y\n         6zyGbqjnXg+nrUN2cJdzIBs9d6f1QUNJE/iKEW78f/oxW0aMdInPUIWREFDBcIsP1E9b\n         lwgA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776928761; x=1777533561;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=b5ucw1jsaiC+LU7Zn1moEYy2AT2i3WtwhP+YNxCDsCQ=;\n        b=KsSF9kQ0kHFnqux2rlZyEVYUKedNEZQGwpT6xXWnPrBf/Di2oIgt90Kb5Z25pR+OIW\n         oQU3QdPk3/pPkdGn1nPkmHvgtBrzmIabwgOykGsSFaNw3atsxKnkuinFVvIUbB5jlHlZ\n         vm6anf1g+vNT98uMnUT1ZrBaUJ21VlAX35uk27dch0FhuZ4cbMAvoL3/Gx3RrAhgUJ/q\n         A5V2cHhYPXDoi3JZNyrg8zjzilrEIURjQKIaX2CZlUpfr6AtGEnz+Zx5d3b75zUoC+sU\n         0ZRMmXAOysNqpav4uySYH0CT3xV/8I2dhQXGTkRrbT/otFGHKGV0mXRFM6IYLitykMCo\n         /LAg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/FBkCk/Gld4FIOcf3ogIUkXqOfHX76WtW3vyKEb3ARIkhLfruEVwMSu244DT+oj+TpBaldwwE80sHlfkY=@lists.ozlabs.org","X-Gm-Message-State":"AOJu0YwIIsIDZlfdyjbwtylBuP9MgBBzygCfUMA1OJHo2UcEguNhsasv\n\tub68Qgc5jo2eK2zrr6diB1xKwlknfARu9dIIilG1Z8bWub81DuAsvYmbrZMySVaI4F0=","X-Gm-Gg":"AeBDieueUXKiLpveUVTRSCWt+AkkK9XsnUN398/xWLNt8v5t5yR3tQ8l7vF0UERDhkh\n\tZAwiFUQlyc6Lcys2NwoLWDgEjvWdFzYkW+PpVn4/9+O6w0aCBsy6jcycg89mRXmTikWHS3oCWsa\n\ttYXRN/tPRM0zRc0mZIcFW3RfoAUj0bgp2mCalIGGgQ0/+o1Vs38GMdNRsIOqvWj58EnAbnxR4/Q\n\tl/YDqv3HZ1czcmLAAyawZDEHTn7I67H6c8zul6T25q9+C/UIWCUrSAo7CX7yPFgsnUAy2d2efYp\n\tCsfpo7FfRMFJTiOCyijpEozkbf492e6FmMcjVUIUhszkxqQUxSkw4IXNtWbsAbOC4gLqfa1lLVp\n\tG5b+ErcsXATHZkEJGOCtnPzsCqt6J8ENOWvFJaZyJTHxdQ2q6a+S6ZY6t380achJrgD8oD4PPnI\n\tAm7QzVp76mHAfJez/J4UneBlEI70iKABaLGwrodWCkXro7EZk+ktC8VA==","X-Received":"by 2002:a17:90b:5543:b0:35f:b227:db86 with SMTP id\n 98e67ed59e1d1-361403af6a5mr26477355a91.2.1776928761356;\n        Thu, 23 Apr 2026 00:19:21 -0700 (PDT)","From":"Muchun Song <songmuchun@bytedance.com>","To":"Andrew Morton <akpm@linux-foundation.org>,\n\tDavid Hildenbrand <david@kernel.org>,\n\tMuchun Song <muchun.song@linux.dev>,\n\tOscar Salvador <osalvador@suse.de>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>","Cc":"Lorenzo Stoakes <ljs@kernel.org>,\n\t\"Liam R . Howlett\" <Liam.Howlett@oracle.com>,\n\tVlastimil Babka <vbabka@kernel.org>,\n\tMike Rapoport <rppt@kernel.org>,\n\tSuren Baghdasaryan <surenb@google.com>,\n\tMichal Hocko <mhocko@suse.com>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\tChristophe Leroy <chleroy@kernel.org>,\n\taneesh.kumar@linux.ibm.com,\n\tjoao.m.martins@oracle.com,\n\tlinux-mm@kvack.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\tMuchun Song <songmuchun@bytedance.com>","Subject":"[PATCH v5 0/6] mm: fix vmemmap optimization accounting and\n initialization","Date":"Thu, 23 Apr 2026 15:19:05 +0800","Message-Id":"<20260423071911.1962859-1-songmuchun@bytedance.com>","X-Mailer":"git-send-email 2.20.1","X-Mailing-List":"linuxppc-dev@lists.ozlabs.org","List-Id":"<linuxppc-dev.lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev+help@lists.ozlabs.org>","List-Owner":"<mailto:linuxppc-dev+owner@lists.ozlabs.org>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Archive":"<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Subscribe":"<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>","List-Unsubscribe":"<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>","Precedence":"list","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Spam-Status":"No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"},"content":"The series fixes several bugs in vmemmap optimization, mainly around\nincorrect page accounting and memmap initialization in DAX and memory\nhotplug paths. It also fixes pageblock migratetype initialization and\nstruct page initialization for ZONE_DEVICE compound pages.\n\nThe first four patches fix vmemmap accounting issues. The first patch\nfixes an accounting underflow in the section activation failure path.\nThe second patch fixes incorrect altmap passing in the error path.\nThe third patch passes pgmap through memory deactivation paths so the\nteardown side can determine whether vmemmap optimization was in effect.\nThe fourth patch uses that information to account the optimized DAX\nvmemmap size correctly.\n\nThe last two patches fix initialization issues in mm/mm_init. One makes\nsure all pageblocks in ZONE_DEVICE compound pages get their migratetype\ninitialized. The other fixes a case where DAX memory hotplug reuses an\nunoptimized early-section memmap while compound_nr_pages() still assumes\nvmemmap optimization, leaving tail struct pages uninitialized.\n\nChangelog:\nv4 -> v5:\n- mm/memory_hotplug: Fix incorrect altmap passing in error path (new bugfix\n  suggested by Sashiko).\n- mm/sparse-vmemmap: Rename section_vmemmap_pages() to\n  section_nr_vmemmap_pages() and use two-tab indent (suggested by David).\n- mm/sparse-vmemmap: Use 1UL for pages_per_compound and use const for\n  order and pages_per_compound (suggested by David).\n- mm/sparse-vmemmap: Simplify VM_WARN_ON_ONCE checks for better readability\n  (suggested by David).\n- mm/mm_init: Use two-tab indent and const for @end in\n  pageblock_migratetype_init_range() (suggested by David).\n- Collect Acked-by tags from David.\n\nMuchun Song (6):\n  mm/sparse-vmemmap: Fix vmemmap accounting underflow\n  mm/memory_hotplug: Fix incorrect altmap passing in error path\n  mm/sparse-vmemmap: Pass @pgmap argument to memory deactivation paths\n  mm/sparse-vmemmap: Fix DAX vmemmap accounting with optimization\n  mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE compound pages\n  mm/mm_init: Fix uninitialized struct pages for ZONE_DEVICE\n\n arch/arm64/mm/mmu.c            |  5 +--\n arch/loongarch/mm/init.c       |  5 +--\n arch/powerpc/mm/mem.c          |  5 +--\n arch/riscv/mm/init.c           |  5 +--\n arch/s390/mm/init.c            |  5 +--\n arch/x86/mm/init_64.c          |  5 +--\n include/linux/memory_hotplug.h |  6 +--\n mm/memory_hotplug.c            | 15 ++++----\n mm/memremap.c                  |  4 +-\n mm/mm_init.c                   | 34 +++++++++-------\n mm/sparse-vmemmap.c            | 37 ++++++++++++++----\n 11 files changed, 81 insertions(+), 45 deletions(-)"}