get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216645,
    "url": "http://patchwork.ozlabs.org/api/patches/2216645/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260327021403.214713-13-usama.arif@linux.dev/",
    "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": "<20260327021403.214713-13-usama.arif@linux.dev>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260327021403.214713-13-usama.arif@linux.dev/",
    "date": "2026-03-27T02:08:54",
    "name": "[v3,12/24] mm: thp: handle split failure in device migration",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": false,
    "hash": "767e6b38e2482e98c2e1cfadcebffc11527e0610",
    "submitter": {
        "id": 92719,
        "url": "http://patchwork.ozlabs.org/api/people/92719/?format=api",
        "name": "Usama Arif",
        "email": "usama.arif@linux.dev"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260327021403.214713-13-usama.arif@linux.dev/mbox/",
    "series": [
        {
            "id": 497678,
            "url": "http://patchwork.ozlabs.org/api/series/497678/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=497678",
            "date": "2026-03-27T02:08:43",
            "name": "[v3,01/24] mm: thp: make split_huge_pmd functions return int for error propagation",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/497678/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216645/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216645/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-18855-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 (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=eUmbqBO7;\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-18855-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2001:41d0:1004:224b::b8\"",
            "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev",
            "lists.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=eUmbqBO7;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.dev\n (client-ip=2001:41d0:1004:224b::b8; helo=out-184.mta0.migadu.com;\n envelope-from=usama.arif@linux.dev; 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 4fhklS1QMmz1y1j\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 13:16:04 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fhkl82grFz2ypW;\n\tFri, 27 Mar 2026 13:15:48 +1100 (AEDT)",
            "from out-184.mta0.migadu.com (out-184.mta0.migadu.com\n [IPv6:2001:41d0:1004:224b::b8])\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 4fhkl74Q0Rz2yjV\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 27 Mar 2026 13:15:47 +1100 (AEDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1774577748;\n\tcv=none;\n b=ZhQREieipuvmtL/pCtp+6b4bveif8rfJgeZo921BS9b08GPQmOgZsDFi5Ep4QIDjlvE6GbodIAuH2SL03xqWLH/QWZLtHfebFbKGq+lJVxFeVTv+9g3cpwvLInT0AvFwwt1hZV0Vb+ejp2hR/pnILk6ZAz2DecJXs5YjbFW1kgsZo19jTacfz4TCh9pOglNIoU/ecmtrEcxilPbSsubepYwDvabG+rypVHVPJm0bfEzBNZ24znipUtgIVbOrKJoeqgAYg+0txa3aR7UXETyAdNBBftNgskss8CfPHs37X92tZ5qeOjmk63g4vhZGq03N5g001pjtkOROqdvND/mdQQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1774577748; c=relaxed/relaxed;\n\tbh=WTevK4s9bqcsyF5dGhWo4MENNp9vZlr+uy9xAQG2jfo=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=jdBY8Pc4Kv+BQNWhAF8ow+nW3GLgx4No8CYFq3Vissa2iKgmCy68Hb0218i7LMUzhZlwA/Ojbt4pjUcGbojCkzpuwuG4Qebb8Clda9YiqrLYiX5VYwT0etHmqqIgL+9e23c+9wC829RPA8Q3ZVRyf2XUZ+Az0ZAyJVLAd8FQbr+Vik++GpztznsToj50XrZIdli2buT5GM7ABK1le6LvDF5UPzNuFBBaq+ZT7bivlADWSr1Ew+7xNcnmbhhMFJY8ulMw6VhfKLH0TKYTmGqky0XdkohFA48KlxQBueHWYTuXJgrQuwXRFgv9mgL9TUCk1fPqpfE9YcuXE8+IbT0TBg==",
        "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev; dkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=eUmbqBO7; dkim-atps=neutral;\n spf=pass (client-ip=2001:41d0:1004:224b::b8; helo=out-184.mta0.migadu.com;\n envelope-from=usama.arif@linux.dev;\n receiver=lists.ozlabs.org) smtp.mailfrom=linux.dev",
        "X-Report-Abuse": "Please report any abuse attempt to abuse@migadu.com and\n include these headers.",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1774577728;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=WTevK4s9bqcsyF5dGhWo4MENNp9vZlr+uy9xAQG2jfo=;\n\tb=eUmbqBO72zX2904RPuTC7NJzAIMHlr5gcD4RVYygo1GU1dDyzany1Q2T9JuiXvkcB8DQd9\n\taunpkimHYmudKZq6kRshELjRaFFsIkn5wCDv9o4AVpLZf/bmSb/rct1ebqgCoY+qovcSBc\n\tl6ygYvG/M7DXmErg92nyDDfRdBDaJ3A=",
        "From": "Usama Arif <usama.arif@linux.dev>",
        "To": "Andrew Morton <akpm@linux-foundation.org>,\n\tdavid@kernel.org,\n\tLorenzo Stoakes <ljs@kernel.org>,\n\twilly@infradead.org,\n\tlinux-mm@kvack.org",
        "Cc": "fvdl@google.com,\n\thannes@cmpxchg.org,\n\triel@surriel.com,\n\tshakeel.butt@linux.dev,\n\tkas@kernel.org,\n\tbaohua@kernel.org,\n\tdev.jain@arm.com,\n\tbaolin.wang@linux.alibaba.com,\n\tnpache@redhat.com,\n\tLiam.Howlett@oracle.com,\n\tryan.roberts@arm.com,\n\tVlastimil Babka <vbabka@kernel.org>,\n\tlance.yang@linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tkernel-team@meta.com,\n\tmaddy@linux.ibm.com,\n\tmpe@ellerman.id.au,\n\tlinuxppc-dev@lists.ozlabs.org,\n\thca@linux.ibm.com,\n\tgor@linux.ibm.com,\n\tagordeev@linux.ibm.com,\n\tborntraeger@linux.ibm.com,\n\tsvens@linux.ibm.com,\n\tlinux-s390@vger.kernel.org,\n\tUsama Arif <usama.arif@linux.dev>",
        "Subject": "[v3 12/24] mm: thp: handle split failure in device migration",
        "Date": "Thu, 26 Mar 2026 19:08:54 -0700",
        "Message-ID": "<20260327021403.214713-13-usama.arif@linux.dev>",
        "In-Reply-To": "<20260327021403.214713-1-usama.arif@linux.dev>",
        "References": "<20260327021403.214713-1-usama.arif@linux.dev>",
        "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-Migadu-Flow": "FLOW_OUT",
        "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled\n\tversion=4.0.1 OzLabs 8",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"
    },
    "content": "Device memory migration has two call sites that split huge PMDs:\n\nmigrate_vma_split_unmapped_folio():\n  Called from migrate_vma_pages() when migrating a PMD-mapped THP to a\n  destination that doesn't support compound pages.  It splits the PMD\n  then splits the folio via folio_split_unmapped().\n\n  If the PMD split fails, folio_split_unmapped() would operate on an\n  unsplit folio with inconsistent page table state.  Propagate -ENOMEM\n  to skip this page's migration. This is safe as folio_split_unmapped\n  failure would be propagated in a similar way.\n\nmigrate_vma_insert_page():\n  Called from migrate_vma_pages() when inserting a page into a VMA\n  during migration back from device memory.  If a huge zero PMD exists\n  at the target address, it must be split before PTE insertion.\n\n  If the split fails, the subsequent pte_alloc() and set_pte_at() would\n  operate on a PMD slot still occupied by the huge zero entry.  Use\n  goto abort, consistent with other allocation failures in this function.\n\nSigned-off-by: Usama Arif <usama.arif@linux.dev>\n---\n mm/migrate_device.c | 22 ++++++++++++++++++++--\n 1 file changed, 20 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/mm/migrate_device.c b/mm/migrate_device.c\nindex 2912eba575d5e..00003fbe803df 100644\n--- a/mm/migrate_device.c\n+++ b/mm/migrate_device.c\n@@ -919,7 +919,19 @@ static int migrate_vma_split_unmapped_folio(struct migrate_vma *migrate,\n \t * drops a reference at the end.\n \t */\n \tfolio_get(folio);\n-\tsplit_huge_pmd_address(migrate->vma, addr, true);\n+\t/*\n+\t * If PMD split fails, folio_split_unmapped would operate on an\n+\t * unsplit folio with inconsistent page table state.\n+\t */\n+\tret = split_huge_pmd_address(migrate->vma, addr, true);\n+\tif (ret) {\n+\t\t/*\n+\t\t * folio_get above was not consumed by split_huge_pmd_address.\n+\t\t * put back that reference.\n+\t\t */\n+\t\tfolio_put(folio);\n+\t\treturn ret;\n+\t}\n \tret = folio_split_unmapped(folio, 0);\n \tif (ret)\n \t\treturn ret;\n@@ -1015,7 +1027,13 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,\n \t\tif (pmd_trans_huge(*pmdp)) {\n \t\t\tif (!is_huge_zero_pmd(*pmdp))\n \t\t\t\tgoto abort;\n-\t\t\tsplit_huge_pmd(vma, pmdp, addr);\n+\t\t\t/*\n+\t\t\t * If split fails, the huge zero PMD remains and\n+\t\t\t * pte_alloc/PTE insertion that follows would be\n+\t\t\t * incorrect.\n+\t\t\t */\n+\t\t\tif (split_huge_pmd(vma, pmdp, addr))\n+\t\t\t\tgoto abort;\n \t\t} else if (pmd_leaf(*pmdp))\n \t\t\tgoto abort;\n \t}\n",
    "prefixes": [
        "v3",
        "12/24"
    ]
}