get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222548,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222548/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260412174334.3111385-4-wangrui@loongson.cn/",
    "project": {
        "id": 41,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/41/?format=api",
        "name": "GNU C Library",
        "link_name": "glibc",
        "list_id": "libc-alpha.sourceware.org",
        "list_email": "libc-alpha@sourceware.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260412174334.3111385-4-wangrui@loongson.cn>",
    "date": "2026-04-12T17:43:31",
    "name": "[v9,3/6] tunables: Add glibc.elf.thp tunable for THP-aware segment alignment",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "f25a5a9b8e909c0e0daf4bcfe0fc17b6f64e4f38",
    "submitter": {
        "id": 85150,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/85150/?format=api",
        "name": "WANG Rui",
        "email": "wangrui@loongson.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260412174334.3111385-4-wangrui@loongson.cn/mbox/",
    "series": [
        {
            "id": 499622,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499622/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=499622",
            "date": "2026-04-12T17:43:29",
            "name": "elf: THP-aware load segment alignment",
            "version": 9,
            "mbox": "http://patchwork.ozlabs.org/series/499622/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222548/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222548/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n dmarc=none (p=none dis=none) header.from=loongson.cn",
            "sourceware.org; spf=pass smtp.mailfrom=loongson.cn",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=114.242.206.163"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ftydP0hkqz1yGg\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 03:46:17 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id D893B4BA2E2B\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 17:46:14 +0000 (GMT)",
            "from mail.loongson.cn (mail.loongson.cn [114.242.206.163])\n by sourceware.org (Postfix) with ESMTP id C692D4BA23DF\n for <libc-alpha@sourceware.org>; Sun, 12 Apr 2026 17:44:24 +0000 (GMT)",
            "from loongson.cn (unknown [223.64.120.66])\n by gateway (Coremail) with SMTP id _____8CxMvHz2dtpE4UkAA--.2567S3;\n Mon, 13 Apr 2026 01:44:19 +0800 (CST)",
            "from localhost (unknown [223.64.120.66])\n by front1 (Coremail) with SMTP id qMiowJBxrsLo2dtpo51rAA--.49052S2;\n Mon, 13 Apr 2026 01:44:13 +0800 (CST)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org D893B4BA2E2B",
            "OpenDKIM Filter v2.11.0 sourceware.org C692D4BA23DF"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org C692D4BA23DF",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org C692D4BA23DF",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776015865; cv=none;\n b=HfW9PPuAjmzBWlvysNaQ72CsFbi0K2spncP5GTw9qlwVdg0FZBRuv9M7WIdNusY545RTGrHQSpiickt37yauz/te2NlV6PakXHrZCZIg9tw/rxSvJ/Y7k8fJBsyw42XFbSWVs8Vi5XO5NpLGuxsrGSqdiIHwg5gpvJ7+AnIqjXo=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776015865; c=relaxed/simple;\n bh=pzIBm5MZkSbBPCe+NFOSDcYU9IEqfnEQwbfbSm8EllM=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=PQWTBJxzZ1MfSLBjlx/v9jyFkrrcRPvvoiMVYF1biZPMtHcI8Tj4EC+fqcLD8j0li6g5bur1Pky5tmwiYK2Dtr3frsllu/qfY49AGXF+wxjHbGHKerXRwpOpIycPyHproSwa0/EsU3w1lN09LQs0w0zYK64T/KLXZOYt/OQE1LQ=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "From": "WANG Rui <wangrui@loongson.cn>",
        "To": "libc-alpha@sourceware.org",
        "Cc": "Adhemerval Zanella <adhemerval.zanella@linaro.org>,\n Dev Jain <dev.jain@arm.com>, Florian Weimer <fweimer@redhat.com>,\n Wilco Dijkstra <Wilco.Dijkstra@arm.com>, Xi Ruoyao <xry111@xry111.site>,\n WANG Xuerui <git@xen0n.name>, caiyinyu <caiyinyu@loongson.cn>,\n mengqinggang <mengqinggang@loongson.cn>,\n Huacai Chen <chenhuacai@kernel.org>, hjl.tools@gmail.com,\n WANG Rui <wangrui@loongson.cn>",
        "Subject": "[PATCH v9 3/6] tunables: Add glibc.elf.thp tunable for THP-aware\n segment alignment",
        "Date": "Mon, 13 Apr 2026 01:43:31 +0800",
        "Message-ID": "<20260412174334.3111385-4-wangrui@loongson.cn>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260412174334.3111385-1-wangrui@loongson.cn>",
        "References": "<20260412174334.3111385-1-wangrui@loongson.cn>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-CM-TRANSID": "qMiowJBxrsLo2dtpo51rAA--.49052S2",
        "X-CM-SenderInfo": "pzdqw2txl6z05rqj20fqof0/",
        "X-Coremail-Antispam": "1Uk129KBj93XoWxCF4xKFyUZrW8ur15tw4UJrc_yoW5AFy3pr\n y3WFWYkrW3AFnxCryay3W5Aa15Jws3Ka4UGry7Kwn7Xw45Cryftay2gr47Ja9rJr47AF47\n ZrZFgr47Cw4kG3cCm3ZEXasCq-sJn29KB7ZKAUJUUUU7529EdanIXcx71UUUUU7KY7ZEXa\n sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU\n 0xBIdaVrnRJUUUBIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2\n IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v\n e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI\n 0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v2\n 6r4j6r4UJwAaw2AFwI0_Jrv_JF1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c\n Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_\n ZF1lYx0Ex4A2jsIE14v26F4j6r4UJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64\n vIr41lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_\n Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc\n xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0\n cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAIw2\n 0EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x02\n 67AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU02Nt7UUUUU==",
        "X-BeenThere": "libc-alpha@sourceware.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>",
        "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>",
        "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>",
        "List-Post": "<mailto:libc-alpha@sourceware.org>",
        "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>",
        "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>",
        "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org"
    },
    "content": "Introduce a new tunable, `glibc.elf.thp`, to control Transparent Huge\nPage (THP) aware alignment of ELF loadable segments.\n\nWhen set to `1`, the dynamic loader will attempt to align sufficiently\nlarge `PT_LOAD` segments to the PMD huge page size when mapping them.\nThis increases the likelihood that the kernel backs these mappings with\nTransparent Huge Pages.\n\nThe default value is `0`, which preserves the traditional page-sized\nalignment and keeps existing behavior unchanged.\n\nOn systems without THP support, or when THP is disabled in the kernel,\nenabling this tunable has no effect.\n\nReviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>\nSigned-off-by: WANG Rui <wangrui@loongson.cn>\n---\n elf/dl-tunables.list |  8 ++++++++\n manual/tunables.texi | 24 ++++++++++++++++++++++++\n 2 files changed, 32 insertions(+)",
    "diff": "diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list\nindex 040a544c0e0..1bbf70d36fa 100644\n--- a/elf/dl-tunables.list\n+++ b/elf/dl-tunables.list\n@@ -24,6 +24,14 @@\n # env_alias: An alias environment variable\n \n glibc {\n+  elf {\n+    thp {\n+      type: INT_32\n+      minval: 0\n+      maxval: 1\n+    }\n+  }\n+\n   malloc {\n     check {\n       type: INT_32\ndiff --git a/manual/tunables.texi b/manual/tunables.texi\nindex cb6a83754b0..12b515c628f 100644\n--- a/manual/tunables.texi\n+++ b/manual/tunables.texi\n@@ -64,6 +64,7 @@ glibc.pthread.mutex_spin_count: 100 (min: 0, max: 32767)\n glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0xffffffffffffffff)\n glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0xffffffffffffffff)\n glibc.malloc.check: 0 (min: 0, max: 3)\n+glibc.elf.thp: 0 (min: 0, max: 1)\n @end example\n \n @menu\n@@ -77,6 +78,8 @@ glibc.malloc.check: 0 (min: 0, max: 3)\n \t\t\t     @theglibc{}.\n * gmon Tunables::  Tunables that control the gmon profiler, used in\n                    conjunction with gprof\n+* ELF Tunables::  Tunables that control Transparent Huge Page (THP)\n+                  aware alignment of ELF loadable segments\n \n @end menu\n \n@@ -763,3 +766,24 @@ whose size exceeds the available memory; in that case, an out of memory\n error will be printed at program startup, the profiler will be\n disabled, and no @file{gmon.out} file will be generated.\n @end deftp\n+\n+@node ELF Tunables\n+@section ELF Tunables\n+@cindex elf tunables\n+\n+@deftp Tunable glibc.elf.thp\n+This tunable controls Transparent Huge Page (THP) aware alignment of\n+ELF loadable segments.\n+\n+The default value is @code{0}, which preserves the traditional page-sized\n+alignment for loadable segments.\n+\n+If set to @code{1}, glibc will attempt to align sufficiently large\n+@code{PT_LOAD} segments to the PMD huge page size when mapping them\n+with @code{mmap}.  This increases the likelihood that the kernel can\n+back these mappings with Transparent Huge Pages.\n+\n+This tunable has an effect only on systems that support Transparent\n+Huge Pages (currently Linux).  On other systems, or if THP is disabled\n+at the kernel level, enabling this tunable has no effect.\n+@end deftp\n",
    "prefixes": [
        "v9",
        "3/6"
    ]
}