Cover Letter Detail
Show a cover letter.
GET /api/1.2/covers/2219870/?format=api
{ "id": 2219870, "url": "http://patchwork.ozlabs.org/api/1.2/covers/2219870/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/cover/20260405035323.558335-1-wangrui@loongson.cn/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/1.2/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": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260405035323.558335-1-wangrui@loongson.cn>", "list_archive_url": null, "date": "2026-04-05T03:53:16", "name": "[v8,0/6] elf: THP-aware load segment alignment", "submitter": { "id": 85150, "url": "http://patchwork.ozlabs.org/api/1.2/people/85150/?format=api", "name": "WANG Rui", "email": "wangrui@loongson.cn" }, "mbox": "http://patchwork.ozlabs.org/project/glibc/cover/20260405035323.558335-1-wangrui@loongson.cn/mbox/", "series": [ { "id": 498763, "url": "http://patchwork.ozlabs.org/api/1.2/series/498763/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=498763", "date": "2026-04-05T03:53:16", "name": "elf: THP-aware load segment alignment", "version": 8, "mbox": "http://patchwork.ozlabs.org/series/498763/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2219870/comments/", "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=2620:52:6:3111::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\n [IPv6:2620:52:6:3111::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 4fpJVy5QqXz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 13:54:32 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id ED22C4BA23E3\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 5 Apr 2026 03:54:29 +0000 (GMT)", "from mail.loongson.cn (mail.loongson.cn [114.242.206.163])\n by sourceware.org (Postfix) with ESMTP id 8ED584BA2E27\n for <libc-alpha@sourceware.org>; Sun, 5 Apr 2026 03:54:07 +0000 (GMT)", "from loongson.cn (unknown [223.64.120.66])\n by gateway (Coremail) with SMTP id _____8Ax_6nZ3NFpexgiAA--.36595S3;\n Sun, 05 Apr 2026 11:54:01 +0800 (CST)", "from localhost (unknown [223.64.120.66])\n by front1 (Coremail) with SMTP id qMiowJBxDOHK3NFpP1JlAA--.44692S2;\n Sun, 05 Apr 2026 11:53:57 +0800 (CST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org ED22C4BA23E3", "OpenDKIM Filter v2.11.0 sourceware.org 8ED584BA2E27" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 8ED584BA2E27", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 8ED584BA2E27", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775361248; cv=none;\n b=LI0jyDjAPrk7ZFd9vKGyz+IgBBANaKA6PKMoBxpV4RAdDcJCtaqjw5sVVqAh+Lor8wqgEB8m0crxfqjKPZFFX4SdZIJ8OdJxcjKZyQ2DpJ2MSN1ZBnQVgpj4A39uCFo/vAVfBaZujVUJM61OSLVQvHmVP2YG4Zg1U/dCnrjG4d4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775361248; c=relaxed/simple;\n bh=77pKPkYzboJdLHD73b8GsdXNNnql3FuILK8ihNX4jxQ=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=uxuOXMwyGM/yb8kW0EBZPuB+Hqxbwe/y3YO8PkFMXIzqUpF5ALwobhBBksMVYyeylL/WyV6v+IZuPq854TK6lyCVAWpVlSejcW6R8+7Fl8yUDmMfsxLvpDcZLT5Xt0ApyqpnG8wNFc3YMTHmXlsJadCkPWEjrmtQTPZNdJ3Qm/8=", "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 v8 0/6] elf: THP-aware load segment alignment", "Date": "Sun, 5 Apr 2026 11:53:16 +0800", "Message-ID": "<20260405035323.558335-1-wangrui@loongson.cn>", "X-Mailer": "git-send-email 2.53.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-CM-TRANSID": "qMiowJBxDOHK3NFpP1JlAA--.44692S2", "X-CM-SenderInfo": "pzdqw2txl6z05rqj20fqof0/", "X-Coremail-Antispam": "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Ik0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v2\n 6r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jOiSdUUUUU=", "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": "OK for commit?\n\nChanges since [v7]:\n * Rename tunable glibc.elf.hugetlb to glibc.elf.thp.\n * Rebase on current master.\n\nChanges since [v6]:\n * Move MAX_THP_PAGESIZE to hugepages.\n * Skip THP mode probing when DL_MAP_DEFAULT_THP_PAGESIZE is non-zero.\n\nChanges since [v5]:\n * No functional changes.\n * Add benchmark results to the commit message.\n\nChanges since [v4]:\n * Merge malloc-hugepages into hugepages.\n * Limit the glibc.elf.hugetlb tunable maximum value to 1.\n\nChanges since [v3]:\n * Rebased on current master.\n * Resolved conflicts with recently merged changes.\n * No functional changes intended.\n\nChanges since [v2]:\n * Refactor THP detection into a new generic hugepages abstraction,\n moving helpers out of malloc-hugepages.\n * Add a new tunable, `glibc.elf.hugetlb`, to control THP-aware ELF\n segment alignment.\n * Move the Linux implementation of `_dl_map_segment_align` to\n sysdeps/unix/sysv/linux/, making it generic for Linux (including\n 32-bit) and avoiding wordsize-64-specific overrides.\n * Use `static inline` instead of `static __always_inline`.\n\nChanges since [v1]:\n * Fix CI build failure (-Wunused-function).\n\nThis patch series introduces a small extension point in the ELF loader to allow\narchitecture-specific adjustment of load segment alignment, and uses it to\nimprove Transparent Huge Page (THP) usage on Linux.\n\nPatch 1 moves Transparent Huge Page helpers into a new generic hugepages\nabstraction, so THP mode detection and default huge page size probing can be\nshared between malloc and the dynamic loader. There is no functional change.\n\nPatch 2 removes a redundant declaration of `_dl_map_segments` from\ndl-load.h, avoiding `-Wunused-function` build failures and keeping the\nprototype colocated with its definition.\n\nPatch 3 adds a new helper, `_dl_map_segment_align`, which is called when\ndetermining the maximum alignment for ELF load segments. The generic\nimplementation is a no-op and preserves existing behavior.\n\nPatch 4 introduces a new tunable, `glibc.elf.hugetlb`, which controls\nTHP-aware alignment of ELF loadable segments. By default, the value is 0\nand existing behavior is preserved.\n\nPatch 5 provides a Linux implementation of `_dl_map_segment_align` that\nopportunistically aligns large, suitably aligned, non-writable `PT_LOAD`\nsegments to the system’s default THP page size when THP is configured to\nbe used unconditionally and the tunable is enabled.\n\nPatch 6 enables this behavior by default on LoongArch64 Linux and defines\nthe default THP page size (32MB), matching the architecture’s PMD huge page\ngeometry.\n\n[v7]: https://sourceware.org/pipermail/libc-alpha/2026-March/175776.html\n[v6]: https://sourceware.org/pipermail/libc-alpha/2026-March/175737.html\n[v5]: https://sourceware.org/pipermail/libc-alpha/2026-March/175694.html\n[v4]: https://sourceware.org/pipermail/libc-alpha/2026-March/175644.html\n[v3]: https://sourceware.org/pipermail/libc-alpha/2026-February/175464.html\n[v2]: https://sourceware.org/pipermail/libc-alpha/2026-February/175394.html\n[v1]: https://sourceware.org/pipermail/libc-alpha/2026-February/175359.html\n\nWANG Rui (6):\n hugepages: Move THP helpers to generic hugepages abstraction\n elf: Remove redundant _dl_map_segments declaration from dl-load.h\n elf: Introduce _dl_map_segment_align hook for segment alignment tuning\n tunables: Add glibc.elf.thp tunable for THP-aware segment alignment\n elf: Align large load segments to PMD huge page size for THP\n loongarch: Enable THP-aligned load segments by default on 64-bit\n\n elf/dl-load.c | 4 ++\n elf/dl-load.h | 5 +-\n elf/dl-tunables.c | 7 +--\n elf/dl-tunables.list | 8 +++\n malloc/malloc-internal.h | 2 +-\n malloc/malloc.c | 27 +++++-----\n manual/tunables.texi | 24 +++++++++\n sysdeps/generic/Makefile | 4 +-\n sysdeps/generic/dl-map-segment-align.h | 26 +++++++++\n .../{malloc-hugepages.c => hugepages.c} | 13 +++--\n .../{malloc-hugepages.h => hugepages.h} | 32 ++++++-----\n sysdeps/unix/sysv/linux/Makefile | 1 +\n .../{malloc-hugepages.h => hugepages.h} | 4 +-\n .../unix/sysv/linux/dl-map-segment-align.c | 53 +++++++++++++++++++\n .../unix/sysv/linux/dl-map-segment-align.h | 27 ++++++++++\n .../linux/{malloc-hugepages.c => hugepages.c} | 33 ++++++------\n .../unix/sysv/linux/loongarch/cpu-features.c | 6 +++\n .../loongarch/lp64/dl-map-segment-align.h | 22 ++++++++\n 18 files changed, 237 insertions(+), 61 deletions(-)\n create mode 100644 sysdeps/generic/dl-map-segment-align.h\n rename sysdeps/generic/{malloc-hugepages.c => hugepages.c} (76%)\n rename sysdeps/generic/{malloc-hugepages.h => hugepages.h} (68%)\n rename sysdeps/unix/sysv/linux/aarch64/{malloc-hugepages.h => hugepages.h} (91%)\n create mode 100644 sysdeps/unix/sysv/linux/dl-map-segment-align.c\n create mode 100644 sysdeps/unix/sysv/linux/dl-map-segment-align.h\n rename sysdeps/unix/sysv/linux/{malloc-hugepages.c => hugepages.c} (89%)\n create mode 100644 sysdeps/unix/sysv/linux/loongarch/lp64/dl-map-segment-align.h" }