Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228369/?format=api
{ "id": 2228369, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228369/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260426092640.375967-6-songmuchun@bytedance.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.1/projects/2/?format=api", "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/" }, "msgid": "<20260426092640.375967-6-songmuchun@bytedance.com>", "date": "2026-04-26T09:26:39", "name": "[v7,5/6] mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE compound pages", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b6e308e63fb4e7c6d4568c035db57fd62573b213", "submitter": { "id": 78930, "url": "http://patchwork.ozlabs.org/api/1.1/people/78930/?format=api", "name": "Muchun Song", "email": "songmuchun@bytedance.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260426092640.375967-6-songmuchun@bytedance.com/mbox/", "series": [ { "id": 501518, "url": "http://patchwork.ozlabs.org/api/1.1/series/501518/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=501518", "date": "2026-04-26T09:26:34", "name": "mm: Fix vmemmap optimization accounting and initialization", "version": 7, "mbox": "http://patchwork.ozlabs.org/series/501518/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228369/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228369/checks/", "tags": {}, "headers": { "Return-Path": "\n <linuxppc-dev+bounces-20118-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=Png3lhOR;\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-20118-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::636\"", "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=Png3lhOR;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com\n (client-ip=2607:f8b0:4864:20::636; helo=mail-pl1-x636.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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g3Lvj2bxDz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 19:27:45 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g3LvX6wdSz2yvy;\n\tSun, 26 Apr 2026 19:27:36 +1000 (AEST)", "from mail-pl1-x636.google.com (mail-pl1-x636.google.com\n [IPv6:2607:f8b0:4864:20::636])\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 4g3LvX14zBz2xlK\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 26 Apr 2026 19:27:36 +1000 (AEST)", "by mail-pl1-x636.google.com with SMTP id\n d9443c01a7336-2b788a98557so41725935ad.2\n for <linuxppc-dev@lists.ozlabs.org>;\n Sun, 26 Apr 2026 02:27:36 -0700 (PDT)", "from n232-176-004.byted.org ([240e:83:200::34a])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b5fab0caa9sm270352885ad.40.2026.04.26.02.27.29\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 26 Apr 2026 02:27:33 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777195656;\n\tcv=none;\n b=cLJMPx0+AKSGJhHerIo7LtrK0B6SVYl6EZzdeVqqxlWcxhiU4CPBwHG3vZUQCBp18qFCtGrJaQHFCaFCp4Bf89QiPV08pd6QI4JlOxr5KbEpq4tI+B7EZZEUKOGAA0sBHicID464GE2g6Jq7VS4E5vVwptHbAXoY1sPe82W18JT9rORHKMCEiaAeCjkvodD/6H+SUArkhkWiIckJVoTJp+sIl5OdAt0Mz/gaV1NLKrH8jsjtm7QbXTfSxe/uOL4koUPR7eIppsiU2XOPnlD3rT1TJ9Ht2QQtTkQEKwiQQVWkMZo7qFHDkYccGJIYvtzL54cXRzrEr2wpsUJBUeaIxw==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1777195656; c=relaxed/relaxed;\n\tbh=X8jAPi1Ug7YtuxDodtBim0VZYTDek6DS5vd5ro+n0/g=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=P5nkyouwLM6cXU7rlf8GM1P36vELmX5Kbku8aQq4/TnHLrFbE3G7GKdlllaZ5bzwKb9FtYBFB/Zp6gmXoJC6aCfmKaHNJ2hQmJ4cuxfjtQCGRf1xhcGdaVPvE/qY4aqXwilJuBLc4jJFBWKdG+nGu/SAAEvjZc+xwqIbz1eVIFzWEf7Tsw63s/f5t6mIRmTWNK39l90xO+J2IlcLEonyxjlILa7IXCo7Y0uWl5S59rR+eQELvAAjD9rhxRP6Ko3t//zO4veqngMvBr8+wh18ohi8y76mCdQ3hSFuQUZotu36ChO1u4wtPoJiAHxONhFgGmKHPBIwSOr3bM9mu0Sn2A==", "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=Png3lhOR; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::636; helo=mail-pl1-x636.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=1777195654; x=1777800454;\n darn=lists.ozlabs.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=X8jAPi1Ug7YtuxDodtBim0VZYTDek6DS5vd5ro+n0/g=;\n b=Png3lhORLygyMYiYihNiCBVSmYuvpiHyRsB8GYP7Ohnro2+q7DYSbzjMsvla9UNCNH\n RMDPrwxMK3+Z0CaynQR3A3Kn/rrK27lYzvteCT29HW1HeENJ1D72OhENuJBZgbc4jf/n\n akB3LCCzGbX1gTV2+EeJpRr4wdt8E7IB4cjBjNb7VAZKxriwGeMFDe2ZQIa2ZhJm9FNJ\n LNXxohkG2kNdb522rh9VeFL2iLq3WK57LNtG1j+UFmaYK/ejTNLX0SGvsuBxuR3I1lgQ\n vsWPkRqLB5j0Ixabo90kfbZOalcYsQ25Ovxff58SAEcIk6d4hyhDoNeqBgOziBFdqqGR\n z90w==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777195654; x=1777800454;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=X8jAPi1Ug7YtuxDodtBim0VZYTDek6DS5vd5ro+n0/g=;\n b=sCojK6Gb/rrLSLHShSXKhuyjfksq3fgLrsT+GbVRSfv2Nhgll3PC8KAuibzBmsb6f5\n MJGphdXNVlmOpoPC9u6Lpw9E9HyKpjw4DPx45a07mgK8dvYaiqbyXhZFVj7elpkKveAG\n tBLTa6J36Ohf8Ecr79rzAzeYR2VKBXxZLDD2LqRqGOgM+3EPdcYR4Y0mxxj9ZexRxT16\n UINcH/q70NDWvce9HUzrsfxWSGsujmekAVBGH2YRASRK7lyAEmUJ8eUrq7yEkscDk9P4\n cnYeszEX4l6TelGi/cBvCG+zLAB8cb9ZO5D1XrF8Zs25gFt+GqcUBlwoQixc87waoISS\n bGrQ==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+7zR9e4UavbTtjr+tNvaK8abZ7O9N0kGVWoqakW4mh/sXRaulJU7CyVKDCl4HOu+JPd+6ysciAKetoo9s=@lists.ozlabs.org", "X-Gm-Message-State": "AOJu0YwoGiiajZVLNRReDH3lsu272hLAdAxPRKX41pzaJunyEXKJqSCb\n\t9sWdxZTOMOCqlx5JHmLLFfMrPaJ9IdorDKu2TxEvHomur5wRN7mGmZsJY40JAmiyEJ8=", "X-Gm-Gg": "AeBDievS6O0BF8JiDlNKE8SdjwOfJ8IzVmxm80Yymg5fw2tqz09eWYZiX0Z1yn0Dxtr\n\ti4PyVq/44CDwnIo2Ce98JYzTffsxpxKHeQwrGVKflTJTm/VIWdMoh6aU2wabR0WcUA1ajPgMni4\n\tlGmGO0v5yILWZ+rSrjznAXH3huzTXYOzL7q1/58N5P23esv06XtZ7VTnGg4l3h9FaneMNvt+U2W\n\tWP3SFxN8k8F+vvqZdKEMo/ua9JL4j4e/UPPmV9fmAwYfmrrUxSuB/hfOHvqenGVl5QEN8E1EbVh\n\t3rG+qZexv4OJB75h5fdW61yjKB/MkeHEvwUTkD5YpysHv6QThtcu18OS7cqlR2/g9lNDrcKmkvI\n\t3IlQlbf3x3VRVmWCxQdgayTA65+i7LHijM8rWL/TIDhYjmyQfwF0ce4pZUewrjeJ1+f08Ek4SAa\n\th7ZPYNsksO9wAEZiWkjFoffmwEwutd", "X-Received": "by 2002:a17:902:da8b:b0:2b9:547d:ccc8 with SMTP id\n d9443c01a7336-2b9547dce05mr31133985ad.30.1777195654294;\n Sun, 26 Apr 2026 02:27:34 -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>,\n\tstable@vger.kernel.org", "Subject": "[PATCH v7 5/6] mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE\n compound pages", "Date": "Sun, 26 Apr 2026 17:26:39 +0800", "Message-Id": "<20260426092640.375967-6-songmuchun@bytedance.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20260426092640.375967-1-songmuchun@bytedance.com>", "References": "<20260426092640.375967-1-songmuchun@bytedance.com>", "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 memmap_init_zone_device() function only initializes the migratetype\nof the first pageblock of a compound page. If the compound page size\nexceeds pageblock_nr_pages (e.g., 1GB hugepages with 2MB pageblocks),\nsubsequent pageblocks in the compound page remain uninitialized.\n\nMove the migratetype initialization out of __init_zone_device_page()\nand into a separate pageblock_migratetype_init_range() function. This\niterates over the entire PFN range of the memory, ensuring that all\npageblocks are correctly initialized.\n\nAlso remove the stale confusing comment about MEMINIT_HOTPLUG above\nthe migratetype setting since it is an obsolete relic from commit\n966cf44f637e (\"mm: defer ZONE_DEVICE page initialization to the point\nwhere we init pgmap\") and no longer makes sense here.\n\nFixes: c4386bd8ee3a (\"mm/memremap: add ZONE_DEVICE support for compound pages\")\nCc: stable@vger.kernel.org\nSigned-off-by: Muchun Song <songmuchun@bytedance.com>\nReviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>\nReviewed-by: Oscar Salvador <osalvador@suse.de>\nAcked-by: David Hildenbrand (Arm) <david@kernel.org>\n---\n mm/mm_init.c | 34 +++++++++++++++++++---------------\n 1 file changed, 19 insertions(+), 15 deletions(-)", "diff": "diff --git a/mm/mm_init.c b/mm/mm_init.c\nindex f9f8e1af921c..cfc76953e249 100644\n--- a/mm/mm_init.c\n+++ b/mm/mm_init.c\n@@ -674,6 +674,20 @@ static inline void fixup_hashdist(void)\n static inline void fixup_hashdist(void) {}\n #endif /* CONFIG_NUMA */\n \n+#ifdef CONFIG_ZONE_DEVICE\n+static __meminit void pageblock_migratetype_init_range(unsigned long pfn,\n+\t\tunsigned long nr_pages, int migratetype)\n+{\n+\tconst unsigned long end = pfn + nr_pages;\n+\n+\tfor (pfn = pageblock_align(pfn); pfn < end; pfn += pageblock_nr_pages) {\n+\t\tinit_pageblock_migratetype(pfn_to_page(pfn), migratetype, false);\n+\t\tif (IS_ALIGNED(pfn, PAGES_PER_SECTION))\n+\t\t\tcond_resched();\n+\t}\n+}\n+#endif\n+\n /*\n * Initialize a reserved page unconditionally, finding its zone first.\n */\n@@ -1011,21 +1025,6 @@ static void __ref __init_zone_device_page(struct page *page, unsigned long pfn,\n \tpage_folio(page)->pgmap = pgmap;\n \tpage->zone_device_data = NULL;\n \n-\t/*\n-\t * Mark the block movable so that blocks are reserved for\n-\t * movable at startup. This will force kernel allocations\n-\t * to reserve their blocks rather than leaking throughout\n-\t * the address space during boot when many long-lived\n-\t * kernel allocations are made.\n-\t *\n-\t * Please note that MEMINIT_HOTPLUG path doesn't clear memmap\n-\t * because this is done early in section_activate()\n-\t */\n-\tif (pageblock_aligned(pfn)) {\n-\t\tinit_pageblock_migratetype(page, MIGRATE_MOVABLE, false);\n-\t\tcond_resched();\n-\t}\n-\n \t/*\n \t * ZONE_DEVICE pages other than MEMORY_TYPE_GENERIC are released\n \t * directly to the driver page allocator which will set the page count\n@@ -1122,6 +1121,9 @@ void __ref memmap_init_zone_device(struct zone *zone,\n \n \t\t__init_zone_device_page(page, pfn, zone_idx, nid, pgmap);\n \n+\t\tif (IS_ALIGNED(pfn, PAGES_PER_SECTION))\n+\t\t\tcond_resched();\n+\n \t\tif (pfns_per_compound == 1)\n \t\t\tcontinue;\n \n@@ -1129,6 +1131,8 @@ void __ref memmap_init_zone_device(struct zone *zone,\n \t\t\t\t compound_nr_pages(altmap, pgmap));\n \t}\n \n+\tpageblock_migratetype_init_range(start_pfn, nr_pages, MIGRATE_MOVABLE);\n+\n \tpr_debug(\"%s initialised %lu pages in %ums\\n\", __func__,\n \t\tnr_pages, jiffies_to_msecs(jiffies - start));\n }\n", "prefixes": [ "v7", "5/6" ] }