get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2227071/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2227071,
    "url": "http://patchwork.ozlabs.org/api/patches/2227071/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260423071911.1962859-6-songmuchun@bytedance.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/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/",
        "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-6-songmuchun@bytedance.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260423071911.1962859-6-songmuchun@bytedance.com/",
    "date": "2026-04-23T07:19:10",
    "name": "[v5,v5,5/6] mm/mm_init: Fix pageblock migratetype for ZONE_DEVICE compound pages",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": false,
    "hash": "b6e308e63fb4e7c6d4568c035db57fd62573b213",
    "submitter": {
        "id": 78930,
        "url": "http://patchwork.ozlabs.org/api/people/78930/?format=api",
        "name": "Muchun Song",
        "email": "songmuchun@bytedance.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260423071911.1962859-6-songmuchun@bytedance.com/mbox/",
    "series": [
        {
            "id": 501152,
            "url": "http://patchwork.ozlabs.org/api/series/501152/?format=api",
            "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/patches/2227071/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227071/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-19997-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=e9vkK1Ez;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19997-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::102a\"",
            "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=e9vkK1Ez;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com\n (client-ip=2607:f8b0:4864:20::102a; helo=mail-pj1-x102a.google.com;\n envelope-from=songmuchun@bytedance.com; receiver=lists.ozlabs.org)"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\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 4g1SCn5tpfz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 17:20:05 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g1SCV0npcz2yth;\n\tThu, 23 Apr 2026 17:19:50 +1000 (AEST)",
            "from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com\n [IPv6:2607:f8b0:4864:20::102a])\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 4g1SCT1vjPz2xSN\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 23 Apr 2026 17:19:49 +1000 (AEST)",
            "by mail-pj1-x102a.google.com with SMTP id\n 98e67ed59e1d1-35fb166b0c6so3681152a91.0\n        for <linuxppc-dev@lists.ozlabs.org>;\n Thu, 23 Apr 2026 00:19:49 -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.42\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 23 Apr 2026 00:19:46 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1776928789;\n\tcv=none;\n b=kqSeQCkzBLWbb9lriUDAjSV0C/xek2Qdh7zplVnpIoD8JM9jW1aqrhDWs8IuomgtBgWxQzawcaKarcegCOGlBISn6mDC0BSwPlTUNYwKilrWtJOk0azMs1GNnof6GxaXEtLUEMwpn1JWtTreRXurcb/S7QqHaiyb54nrL23Lrq2c5R/Ao0HlEUxMptia6mkGIpvvuVwVK6HUCcvKHAtQHI7WjGOTUKcia3aJik8eKcWDV4Tr4ODW83wuXdjp1dTeJXzYzWxGqzzlsl89ZFsTKv3swaXi+8NpCWLt4XKdp2VOChusLvtcAwPKuCvyx0sPdCVoGszGAHF/UHDQgqSm2w==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1776928789; c=relaxed/relaxed;\n\tbh=0E6l7+8OUQ4Tga+WuEBz2tFLFSj0y7aaAPGsd1rn1yk=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=dcjpYvIO6LD6CSg9r8KMEaijI8fJG3+M66d9GRprBXLe5zJ4YUCRqiRwsMJ/iEDNxO5+tkVyQLGSSOjwC7pg7wSMPknmyOFOW4Hhbx0JzDFDLJ88Gfk/mBS68DoXtxuBRipDU/zZVoUjAHgzsbnoFGmhEPtEWLpod2XgM8txf6THCceGiKRGqKQvM4LC89jkLYw+OrFnVZFfYuDo5L0fkoLWGiYBU4iDoCB/+O/BBDVloMVhSY9QbJS9kuV/3zMimK/XJc5qM3S0w/R7j6N9k9cFmdaczlo3/1FNrnTpkQp2JC+9Av13p/bMbvPhBg725/kGPLOIBMSqx8ATGR2LzA==",
        "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=e9vkK1Ez; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::102a; helo=mail-pj1-x102a.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=1776928787; x=1777533587;\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=0E6l7+8OUQ4Tga+WuEBz2tFLFSj0y7aaAPGsd1rn1yk=;\n        b=e9vkK1EzlpFBB6p6HCuIi7ByPAphZzhLnrdDB8u4OnFBkomS+/4DW+zuAErfTofG1X\n         hRCRisqOKnk7LvfWs9yivBwejLqTYKmnIbTJg0P9st4wORDUtVkTcMZsJ8b2W+jpWP2V\n         lf0C2WiXf2gzKYtST3F7ZXCNCl3I+Vsw8XLGRSASEWuKupP2r9YZT6GklaTgj3pw+SHS\n         G1YvPEZgNcJn5nwJ4LeqjNq4DGOBhKhAbZy3K87p77thxDiA57AccNLn19u8qBaucTlo\n         OsRL7RLLQBm3HVXNmDAyzgdKjeU4UfevX4qVS8BaaYsZ8Soxt66Zgm8dKkXxAiv3h+SB\n         dcFg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776928787; x=1777533587;\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=0E6l7+8OUQ4Tga+WuEBz2tFLFSj0y7aaAPGsd1rn1yk=;\n        b=HCep4wagGK8VHeZiRnQcljzURAfW2StECigL2tXlgT8e2/lzNXKHDiweU///py5wcY\n         oy5zau9DbQnEfXcJ7dRQM2SDnEPHfRU2CddaFjG852F1oMrUpyIjlWYIP2h9srvitF1H\n         pIuEy9GC5dRgEQ54qKawsuYL/hYrdASOYmNcnN3a+ss8gmKB9J3nCvMFRGooHWK9LiVw\n         puSnmmj2URJJ35WPfTZ+dqTjHLg7vCs5azxdfIDVlF4Z5WsAlAxdZPai9slj3cJ6MivE\n         N9h7aBXvhDdWfxY7ZrtBcdqgKl9ipaCVq1y1O3UXZbJ0pmafybm54pIV/pBKCI+RPGvy\n         AjUw==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ9TdBn8WwEU7wI4Gy2HR9h9cHbzsERMCYKN0IH7Bdpa9jK5MCidVPrvuMW/ODB6eotwG5ma0h5zeuXCwBA=@lists.ozlabs.org",
        "X-Gm-Message-State": "AOJu0YxeFtHPRBGaqqdSa33nwiknGAplmrCxh3Iow82Zca7O0xnUd9nM\n\tXM1dd3Hl3/cypR5vJ66lFX1QPAvf0y4egg4LKJDrJBJnDI0mFEKlUT9soM0NgsoIM4M=",
        "X-Gm-Gg": "AeBDieu9L7ehfvR8t1IGjoQ1FOyvaA5Cv+SSajY6ffT5ItsCpXOMIJ4wi3ZmjexCesf\n\tZqqZiPi2LRAwM0HKvh+v/fqBnFikf8XtBWw0QwX0ulp/GEZuX+cB7TIM8fnRpNGjhOKrZi1Yi98\n\tUqzHNaI7bu3agusHUun63THZJKOB2Y2Xv2HiL9x9QgWas67m8r2d3tHuBbdCWS4Iv6aNLuYZP8q\n\tSUt/zeILl5O06NXFfH+MZ12taZNjLdbpRiR8drU/fwbi0IdvH8CroAarR/JBAzobC8gXAhdkWim\n\tcun54JASqNiNMDHJfDeKhUSfBpMd7Wl0mMy3GiBqZ3bfWaqO/n6X9GwFn/dLJqNlHK4PBv9EeXX\n\tZjXcbfUIUeIKDqprIz2t62FsyWjiSV3EgqAmk14lsBJPF/l322UIAxFrq7Y/xX4QvlmMq5ah2/C\n\tJ999QOmCRH9O3QhpP6UL1vfRlEchfBBl8eJfBY4O8k834voKJMLP1RZg==",
        "X-Received": "by 2002:a17:90b:3ec5:b0:35f:b4c1:91ea with SMTP id\n 98e67ed59e1d1-361402ee818mr20270410a91.13.1776928787371;\n        Thu, 23 Apr 2026 00:19:47 -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 v5 5/6] mm/mm_init: Fix pageblock migratetype for\n ZONE_DEVICE compound pages",
        "Date": "Thu, 23 Apr 2026 15:19:10 +0800",
        "Message-Id": "<20260423071911.1962859-6-songmuchun@bytedance.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20260423071911.1962859-1-songmuchun@bytedance.com>",
        "References": "<20260423071911.1962859-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\")\nSigned-off-by: Muchun Song <songmuchun@bytedance.com>\nReviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>\nReviewed-by: Oscar Salvador <osalvador@suse.de>\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": [
        "v5",
        "v5",
        "5/6"
    ]
}