[{"id":3676465,"web_url":"http://patchwork.ozlabs.org/comment/3676465/","msgid":"<CAMe9rOoMtg1ejWOrqUgN3ke3Lv6-TT-wcKvJU49Vwsr+Q+o3kQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-13T05:35:09","subject":"Re: [PATCH v9 0/6] elf: THP-aware load segment alignment","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/people/4387/","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"content":"On Mon, Apr 13, 2026 at 1:44 AM WANG Rui <wangrui@loongson.cn> wrote:\n>\n\nHi,\n\nPlease take a look at users/hjl/hugepage/master branch:\n\nhttps://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/hugepage/marker\n\nIt includes\n\n30cd1f2158 elf: Support THP segment load with THP enabled with madvise\n6db7f33e4e Check if linker supports -z separate-code\n562148f88e x86-64: Disable THP segment load for tst-valgrind-smoke\n\nPlease test its performance under madvise THP kernel.\n\n\n> Changes since [v8]:\n>   * Add a new test case.\n>   * Minor formatting fixes.\n>   * Mark _dl_map_segment_align with attribute_hidden.\n>\n> Changes since [v7]:\n>   * Rename tunable glibc.elf.hugetlb to glibc.elf.thp.\n>   * Rebase on current master.\n>\n> Changes since [v6]:\n>   * Move MAX_THP_PAGESIZE to hugepages.\n>   * Skip THP mode probing when DL_MAP_DEFAULT_THP_PAGESIZE is non-zero.\n>\n> Changes since [v5]:\n>   * No functional changes.\n>   * Add benchmark results to the commit message.\n>\n> Changes since [v4]:\n>   * Merge malloc-hugepages into hugepages.\n>   * Limit the glibc.elf.hugetlb tunable maximum value to 1.\n>\n> Changes since [v3]:\n>   * Rebased on current master.\n>   * Resolved conflicts with recently merged changes.\n>   * No functional changes intended.\n>\n> Changes 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>\n> Changes since [v1]:\n>   * Fix CI build failure (-Wunused-function).\n>\n> This patch series introduces a small extension point in the ELF loader to allow\n> architecture-specific adjustment of load segment alignment, and uses it to\n> improve Transparent Huge Page (THP) usage on Linux.\n>\n> Patch 1 removes a redundant declaration of `_dl_map_segments` from\n> dl-load.h, avoiding `-Wunused-function` build failures and keeping the\n> prototype colocated with its definition.\n>\n> Patch 2 adds a new helper, `_dl_map_segment_align`, which is called when\n> determining the maximum alignment for ELF load segments. The generic\n> implementation is a no-op and preserves existing behavior.\n>\n> Patch 3 introduces a new tunable, `glibc.elf.hugetlb`, which controls\n> THP-aware alignment of ELF loadable segments. By default, the value is 0\n> and existing behavior is preserved.\n>\n> Patch 4 provides a Linux implementation of `_dl_map_segment_align` that\n> opportunistically aligns large, suitably aligned, non-writable `PT_LOAD`\n> segments to the system’s default THP page size when THP is configured to\n> be used unconditionally and the tunable is enabled.\n>\n> Patch 5 enables this behavior by default on LoongArch64 Linux and defines\n> the default THP page size (32MB), matching the architecture’s PMD huge page\n> geometry.\n>\n> Patch 6 adds a new test for THP alignment of large load segments.\n>\n> [v8]: https://sourceware.org/pipermail/libc-alpha/2026-April/176440.html\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>\n> WANG Rui (6):\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>   elf: Add test for THP alignment of large load segments\n>\n>  elf/dl-load.c                                 |   4 +\n>  elf/dl-load.h                                 |   5 +-\n>  elf/dl-tunables.list                          |   8 +\n>  manual/tunables.texi                          |  24 +++\n>  sysdeps/generic/dl-map-segment-align.h        |  26 +++\n>  sysdeps/unix/sysv/linux/Makefile              |   8 +-\n>  .../unix/sysv/linux/dl-map-segment-align.c    |  55 +++++++\n>  .../unix/sysv/linux/dl-map-segment-align.h    |  27 ++++\n>  .../unix/sysv/linux/loongarch/cpu-features.c  |   6 +\n>  .../loongarch/lp64/dl-map-segment-align.h     |  22 +++\n>  sysdeps/unix/sysv/linux/tst-thp-align.c       | 149 ++++++++++++++++++\n>  sysdeps/unix/sysv/linux/tst-thp-size-mod.S    |  22 +++\n>  12 files changed, 352 insertions(+), 4 deletions(-)\n>  create mode 100644 sysdeps/generic/dl-map-segment-align.h\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>  create mode 100644 sysdeps/unix/sysv/linux/loongarch/lp64/dl-map-segment-align.h\n>  create mode 100644 sysdeps/unix/sysv/linux/tst-thp-align.c\n>  create mode 100644 sysdeps/unix/sysv/linux/tst-thp-size-mod.S\n>\n> --\n> 2.53.0\n>","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\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=i7hAvjDH;\n\tdkim-atps=neutral","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\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=i7hAvjDH","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=2607:f8b0:4864:20::1030"],"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 4fvGNY49YDz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 15:36:13 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 8C16E4BA2E2A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 05:36:11 +0000 (GMT)","from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com\n [IPv6:2607:f8b0:4864:20::1030])\n by sourceware.org (Postfix) with ESMTPS id 218C14BA2E10\n for <libc-alpha@sourceware.org>; Mon, 13 Apr 2026 05:35:50 +0000 (GMT)","by mail-pj1-x1030.google.com with SMTP id\n 98e67ed59e1d1-35dac556bb2so2271495a91.1\n for <libc-alpha@sourceware.org>; Sun, 12 Apr 2026 22:35:50 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 8C16E4BA2E2A","OpenDKIM Filter v2.11.0 sourceware.org 218C14BA2E10"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 218C14BA2E10","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 218C14BA2E10","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776058550; cv=pass;\n b=P9cxaR6qW+qrjX8+dKt/qtP0FA1c2LkQoV96Iky6b0PyOtODbpS6mDon80hRn69PcalCTYgLKf0NDq2dqPG6amZIkiscgPPnB7dBPXd1oCuWOdsZ+67n78X65vglrGdWxyv1H62tSCtlB3aLcqpjbpVg6ij2hAkon6qV/TECEmE=","i=1; a=rsa-sha256; t=1776058547; cv=none;\n d=google.com; s=arc-20240605;\n b=UMGdEYUr1yvdQDPfOM1WtcmuxjEMZ6QY0wTMsLi/BXEHKMJDXLLQPOTwfNQU1n8/Kc\n VVqf1J0TFNiYctP2Pju28CJ+VhHiJqfa6yBpSKhUH+BYQzbPUX5aVdi4TxVYf6AcgFy3\n K0DroA8WcUkZD1NQs8wim+ayNLMODFFXlA62I6p102hRY0iS0k0O6coryaF+Z4ih4Ve5\n VWkjY140ZaAd3n6buGg8FuWmyd1qLKzyZ14pgZNhCsYOVVz3DNS7X/6EHvCfgabt6IEI\n f15NetFvqUapwcv1rOjDD33PG4Z1oyct1Xw/TqJvmt/228Ob8Jgb35A5vBY7zvfk+YZg\n 7QWA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776058550; c=relaxed/simple;\n bh=bdtsmaMPw3OqeCxiSO1s+r3EhP6UXvayxFuiaKs1p8o=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=PUjGRKvsbkid5mJQuMHErxzkPAseqjWqsM1Bf8B2Jrhiy//s9lByHTMmk7WCv17y4JVaVNoCuTYQT3sAOwIrW2/X6fJTGSppngHXimiWrZORCHhJpPX2VPHbCxQLH+ElZmSwH6nhLGP7WDG4Dy/nDlMfzi8+WVYyq78xR4JPJ00=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=H7K1dAIr+Z5shqgh/O4Xpj0qO/byx9a3tix/4xKzBKM=;\n fh=gYlpH3AzoGPM3wlaN1BXlxx6htyahongdwVEZUO8w/Q=;\n b=Ytl2W1Y8CL7pmCx/ZvQ8rmkPGNlULj2WH/aONqlOok6HrRY0vLGHSxVxUb9tdZnHho\n 0GGeOsuXqWXsI0/Xd3FVfB8DM27Y+Gyhcskrmp5WkNqfuVbs8GGIc+P0ToHxlVa8grZO\n +O/na+2H7+GBvW/TN5VuhjowXzG+M+c8ZE7gUZxYIWIEPOCwtUjWp6RSR68dK27gVll+\n 7cq1fKuhjvrI9sHmrPSDqSFkk22AHGXI3EGlcxLb0rhls4Lww6mE4t9N86eC3b6rCoV3\n oZax1QhXPIX5flVpBfaMxAQutZQ8H9/1jtC80cpNegEIMACqaPB/D9KVtVf+BYOwuMoD\n c8bQ==; darn=sourceware.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776058547; x=1776663347; darn=sourceware.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=H7K1dAIr+Z5shqgh/O4Xpj0qO/byx9a3tix/4xKzBKM=;\n b=i7hAvjDHukiw2VmO1RFNA3wROJJ24P6VSkBJi+Y6gAGn/hxoc9vUwjvKXuMPShuLea\n +Bhvo6F5RP+dYg6APPuiKHglBkHg1biyJ9qdVQ37kxE27f1r5SpYvxMNbUH5hiIQn1tD\n O6ndRpd4W+ktShXMEpiM2T7YCmXr72jQJh8465GUl5TH7ojZ/hzzC35d7VwqvWi5KxEh\n 9iQLons73lnyBAA/KuXbJdVHV1hGNAtG3JCByrEdyLeaU+xmjjDlGOaV8jBDgrJQI4/k\n z002+UzBoyJ2QDN86YJykr49tLhzU+ayaiZxJfG1N3PrHCgXw9nZPNIX7UAPFtHwlNpC\n cqyg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776058547; x=1776663347;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=H7K1dAIr+Z5shqgh/O4Xpj0qO/byx9a3tix/4xKzBKM=;\n b=WH9bA4wqSAWG3VSAvCo1FOdmCYFowY99ZBgwtKx/Sql87Kt3dTd3FnUg0MnIRHkSjt\n AqzURipSqnj8SaJtn9710R+ZLP4Ib3fVqhEEeGFQq+L02cvtShq0B7/+2yxXZxTKbDW3\n vXYhW5nqVifKBrBLRHu6kMFXZ/1O54bp5+cwPMcmhz/UljSOZ/CWAKcsaePlnO1Fhysy\n 3PMJtwJq9kB0hgHwFMpBTgnYFHn0OMCuF+5EnTbhwbsGD8x+sFq0x6BfnGsA6clLaoNX\n Br5rUuv53ELRU7+omd35T+47Cdx3532fegP0dsuNUirYXOj/WjnrHyNX46BsTwLI2oJB\n 6Kjg==","X-Gm-Message-State":"AOJu0YwioxuEBcxrCXukTcV+a6Ghynre3o05+CpBaLPzva/Pdm8TyHaH\n 6PI0rZ/eQdBHNoB8277AupzOv7KAAIGm4fuWIYm5NsjG4vSKge5T2pLaYoztVa1iv/ldgCI1EBm\n a/b5tu2/MExH1oVwYSN0O1uVPFZAsgx8=","X-Gm-Gg":"AeBDievPkmJse3H5cCMq7Ttmrq2xCXfVFo2PMkSpV1D7KBbVWIxn0u9lIfMzyZ9Ou7H\n 9vev9/Wwh2oSB3Me3VhSuiggnNIqVO6Uf3h2tLlrgg0Uyr9J9wUIsn3QCwu79mG+K2+1EgFm9s8\n ucNpyZAfjT1XwLFurff7s3PwnefU7Lh4jMkApxYwQ13Ilf7o2lTf2zBtD7/oeTlagX82YVgM1Ms\n tO+o/SoA6TEFDtEtj42j6H2QOS/ndD0plgX7BQIcvEdh6xMHzcc3AEX51OmubBRALUgrcL4HHgL\n e9tPZA==","X-Received":"by 2002:a17:90b:2e8c:b0:35d:b00a:3c54 with SMTP id\n 98e67ed59e1d1-35e42838493mr11927139a91.22.1776058547179; Sun, 12 Apr 2026\n 22:35:47 -0700 (PDT)","MIME-Version":"1.0","References":"<20260412174334.3111385-1-wangrui@loongson.cn>","In-Reply-To":"<20260412174334.3111385-1-wangrui@loongson.cn>","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","Date":"Mon, 13 Apr 2026 13:35:09 +0800","X-Gm-Features":"AQROBzBH7odfN5Fx5U-a8D8ZQ0rE9l-neVZ5snROSGHiSf5IUjlR1kd37-ru2b8","Message-ID":"\n <CAMe9rOoMtg1ejWOrqUgN3ke3Lv6-TT-wcKvJU49Vwsr+Q+o3kQ@mail.gmail.com>","Subject":"Re: [PATCH v9 0/6] elf: THP-aware load segment alignment","To":"WANG Rui <wangrui@loongson.cn>","Cc":"libc-alpha@sourceware.org,\n Adhemerval Zanella <adhemerval.zanella@linaro.org>,\n Dev Jain <dev.jain@arm.com>,\n Florian Weimer <fweimer@redhat.com>, Wilco Dijkstra <Wilco.Dijkstra@arm.com>,\n Xi Ruoyao <xry111@xry111.site>, WANG Xuerui <git@xen0n.name>,\n caiyinyu <caiyinyu@loongson.cn>,\n mengqinggang <mengqinggang@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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"}},{"id":3677020,"web_url":"http://patchwork.ozlabs.org/comment/3677020/","msgid":"<CAMe9rOpxRYMN3HZDkiG=EeVgzjq0GZAS-ss8V7OfFOdT3hNz1w@mail.gmail.com>","list_archive_url":null,"date":"2026-04-14T04:23:47","subject":"Re: [PATCH v9 0/6] elf: THP-aware load segment alignment","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/people/4387/","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"content":"On Mon, Apr 13, 2026 at 1:35 PM H.J. Lu <hjl.tools@gmail.com> wrote:\n>\n> On Mon, Apr 13, 2026 at 1:44 AM WANG Rui <wangrui@loongson.cn> wrote:\n> >\n>\n> Hi,\n>\n> Please take a look at users/hjl/hugepage/master branch:\n>\n> https://gitlab.com/x86-glibc/glibc/-/commits/users/hjl/hugepage/marker\n>\n> It includes\n>\n> 30cd1f2158 elf: Support THP segment load with THP enabled with madvise\n> 6db7f33e4e Check if linker supports -z separate-code\n> 562148f88e x86-64: Disable THP segment load for tst-valgrind-smoke\n>\n> Please test its performance under madvise THP kernel.\n\nI updated users/hjl/hugepage/master branch to fix a few bugs and\nremove merging 2 PT_LOAD segments.\n\n>\n> > Changes since [v8]:\n> >   * Add a new test case.\n> >   * Minor formatting fixes.\n> >   * Mark _dl_map_segment_align with attribute_hidden.\n> >\n> > Changes since [v7]:\n> >   * Rename tunable glibc.elf.hugetlb to glibc.elf.thp.\n> >   * Rebase on current master.\n> >\n> > Changes since [v6]:\n> >   * Move MAX_THP_PAGESIZE to hugepages.\n> >   * Skip THP mode probing when DL_MAP_DEFAULT_THP_PAGESIZE is non-zero.\n> >\n> > Changes since [v5]:\n> >   * No functional changes.\n> >   * Add benchmark results to the commit message.\n> >\n> > Changes since [v4]:\n> >   * Merge malloc-hugepages into hugepages.\n> >   * Limit the glibc.elf.hugetlb tunable maximum value to 1.\n> >\n> > Changes since [v3]:\n> >   * Rebased on current master.\n> >   * Resolved conflicts with recently merged changes.\n> >   * No functional changes intended.\n> >\n> > Changes 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> >\n> > Changes since [v1]:\n> >   * Fix CI build failure (-Wunused-function).\n> >\n> > This patch series introduces a small extension point in the ELF loader to allow\n> > architecture-specific adjustment of load segment alignment, and uses it to\n> > improve Transparent Huge Page (THP) usage on Linux.\n> >\n> > Patch 1 removes a redundant declaration of `_dl_map_segments` from\n> > dl-load.h, avoiding `-Wunused-function` build failures and keeping the\n> > prototype colocated with its definition.\n> >\n> > Patch 2 adds a new helper, `_dl_map_segment_align`, which is called when\n> > determining the maximum alignment for ELF load segments. The generic\n> > implementation is a no-op and preserves existing behavior.\n> >\n> > Patch 3 introduces a new tunable, `glibc.elf.hugetlb`, which controls\n> > THP-aware alignment of ELF loadable segments. By default, the value is 0\n> > and existing behavior is preserved.\n> >\n> > Patch 4 provides a Linux implementation of `_dl_map_segment_align` that\n> > opportunistically aligns large, suitably aligned, non-writable `PT_LOAD`\n> > segments to the system’s default THP page size when THP is configured to\n> > be used unconditionally and the tunable is enabled.\n> >\n> > Patch 5 enables this behavior by default on LoongArch64 Linux and defines\n> > the default THP page size (32MB), matching the architecture’s PMD huge page\n> > geometry.\n> >\n> > Patch 6 adds a new test for THP alignment of large load segments.\n> >\n> > [v8]: https://sourceware.org/pipermail/libc-alpha/2026-April/176440.html\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> >\n> > WANG Rui (6):\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> >   elf: Add test for THP alignment of large load segments\n> >\n> >  elf/dl-load.c                                 |   4 +\n> >  elf/dl-load.h                                 |   5 +-\n> >  elf/dl-tunables.list                          |   8 +\n> >  manual/tunables.texi                          |  24 +++\n> >  sysdeps/generic/dl-map-segment-align.h        |  26 +++\n> >  sysdeps/unix/sysv/linux/Makefile              |   8 +-\n> >  .../unix/sysv/linux/dl-map-segment-align.c    |  55 +++++++\n> >  .../unix/sysv/linux/dl-map-segment-align.h    |  27 ++++\n> >  .../unix/sysv/linux/loongarch/cpu-features.c  |   6 +\n> >  .../loongarch/lp64/dl-map-segment-align.h     |  22 +++\n> >  sysdeps/unix/sysv/linux/tst-thp-align.c       | 149 ++++++++++++++++++\n> >  sysdeps/unix/sysv/linux/tst-thp-size-mod.S    |  22 +++\n> >  12 files changed, 352 insertions(+), 4 deletions(-)\n> >  create mode 100644 sysdeps/generic/dl-map-segment-align.h\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> >  create mode 100644 sysdeps/unix/sysv/linux/loongarch/lp64/dl-map-segment-align.h\n> >  create mode 100644 sysdeps/unix/sysv/linux/tst-thp-align.c\n> >  create mode 100644 sysdeps/unix/sysv/linux/tst-thp-size-mod.S\n> >\n> > --\n> > 2.53.0\n> >\n>\n>\n> --\n> H.J.","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\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Wajvdzzf;\n\tdkim-atps=neutral","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\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Wajvdzzf","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=2607:f8b0:4864:20::635"],"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 4fvrlj3W3jz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 14:24:49 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id A0CC84BA2E20\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 04:24:47 +0000 (GMT)","from mail-pl1-x635.google.com (mail-pl1-x635.google.com\n [IPv6:2607:f8b0:4864:20::635])\n by sourceware.org (Postfix) with ESMTPS id 7734E4BA2E11\n for <libc-alpha@sourceware.org>; Tue, 14 Apr 2026 04:24:26 +0000 (GMT)","by mail-pl1-x635.google.com with SMTP id\n d9443c01a7336-2b2503753efso43648405ad.0\n for <libc-alpha@sourceware.org>; Mon, 13 Apr 2026 21:24:26 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org A0CC84BA2E20","OpenDKIM Filter v2.11.0 sourceware.org 7734E4BA2E11"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 7734E4BA2E11","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 7734E4BA2E11","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776140666; cv=pass;\n b=wZ+Byem8AeRe+tK+l7sV2YF5crIkn6KHT1lfbpOZdqOvK+dkOBZX/qqCjjVOJ5YnRVfvtHwzNzuEDsDarvSomNE20+cRYtTQ+gQ1aiAXEpnyYT2APtSo04Tz8bhEllteINKheET+OVrOpbKwDrSfHfxBhKDGmJ6laNPSfjvaHAo=","i=1; a=rsa-sha256; t=1776140664; cv=none;\n d=google.com; s=arc-20240605;\n b=jt1ByyW4dI9SI/7m2stbWsQIezTG2CXCYrh4SgF7Us02afqTlu4H3XyfyxM8i+x9gm\n dsV5/rBfppbaD7M8o/1iX/tPBrGb8p3vybNqhZW25EtQBISa2BXSPCdbDRCXNRaeFBcF\n hT8h5YtLU7JNF/vDZxWTtFNWkGGAVwOAEGzzbur3BCjei10PgbdmCLOqHf2eJJ0Tyo9s\n IdmrbF3BagiUf58B0l/xHmBM//fA3TVNhnjM9iD3H6IRUeUZCC9P6oPyBa29pko1fjyv\n UZa9yeWl8idlb1W9cTdnBrAnG6M9L0r93MPCty3g5dVCJcwmOm0zBvfEls5coZ5Uflb7\n ta3A=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776140666; c=relaxed/simple;\n bh=E3POYKA9qJ6jta6/xifALPTOL/LEegjbhBQEPjpRsrw=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=lRlOSt8wt7BFjx7mcStC/htwrZONXdFJhv+1vzYPbZG2PqTKNy6guPl3QOHacjFQzpHVmLtFAEZ6YpK+4p7T7aE6ooHUq+GDN3nRViBpD83AJJOXfTicmduBpgfgfBGTrf+rOLsKIFniyD4ty26v1p55NUCwCW53CQmQHejwFVE=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=FV26h3OrXell7W9XYenMXUF98Q6oy7w622Tvcuk/Hqg=;\n fh=gYlpH3AzoGPM3wlaN1BXlxx6htyahongdwVEZUO8w/Q=;\n b=Ez692hUDQN8AzQOWOOoKqubEpJzgBGopxjq/ubTutSebUjJv+C35MBwwsNTSbQcU4q\n g1r352wVyGKxscItVUwt3hftzIR///NMn7A45W6iYrqWVvBGUXkv2Bkf18NpRWvj2fjI\n 6b0c/PzFVyQc1YuXH3JfPoNbk7jq+wXYY4KhhiXw3ADl9C99OgQihrkOJ3Mr0qnns/yw\n S5HMMRK1eBKnkxjdN80I/GkoxiAj1s8lDp6E54TwHXakOzq8owNRo2GVHh8BxQVTusp+\n Xpq7jTUhSmvS1x5N8cD7THqTZA5HbMDmFWgSBBwTAU8FBsnK5W7OflyeWvlJoBFuaFzI\n DNYA==; darn=sourceware.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776140664; x=1776745464; darn=sourceware.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=FV26h3OrXell7W9XYenMXUF98Q6oy7w622Tvcuk/Hqg=;\n b=WajvdzzftxRRszFw29zW+/uqHT+FBmE8jcoKNdqOd3yg0HWM58OLPbEdboRkC3TTJJ\n r4BLJZKNqCYSkCKodQ8EnwCxT+nBFRYL2mUv0RR9cAZS6i+0l/r5BPgG1H8YH7fX4vLn\n h4O+XpdJFLQ6qqC448Sus4BesG8CS9JAARbC8mOrWF1IZpFKxfrdigByInaIsPsCIf0H\n qU457qZIz9+VY/ESF5rKkB/UXdn7PQkYolSLq5q8Vu7LS5CJL7LE04rb/TE01JXqPta0\n qEqaNaexAvCahiTjjHWNOnjHhdjrL2enpNxtSQKh4kzHLufUfyOB0QK2LP/vWLg9tg9Z\n 5EUA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776140664; x=1776745464;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=FV26h3OrXell7W9XYenMXUF98Q6oy7w622Tvcuk/Hqg=;\n b=RU+YeBavaiiUdCskV4yRUlfeooXSNrl2yHBYSUDB8ULECuXa9+w8Ph2K3uJT4JOk1q\n BvRhe8ABBq9OkSg2YYJ35JZvPNY3kRFwYOzw4OGyeiLUB2CaoV0Slq5D3SoKGezW5b7U\n Ni21+J3d5QJaeQVMLNpv+XpmcoMSwtX44patdZv0sx8H5tL3hSzH8ZMjc2yJpqo1v7b3\n GwY+xs/Ox9dN25UKeUvo6mMkuQmDpHtZk9A/aDnJTTb9/kK48bW2XwocMbhx3nkZu8+f\n SGoQqChvHS1ZbGDQN+j+jStUyUOAVZmNVJSaSBWrkmYq4GmjCZGncNM12Sbt52ZEsWnf\n CgzA==","X-Gm-Message-State":"AOJu0YzOR5C9Vu+/r1gIH9vwcLLQ88FvIfJ1l9vwhjOVuBVpYlf+8ge9\n QotC6Hu2ftPR98v+MmisIAv6Hd/K9Fl9KJUMzL/Pm9XR1f4L7yuxtVDFxnrKh2L39QWRzGlpznz\n iVN3QNywt9kcIxKQybCEAhXJIO2h2R8BW5F1V8OfD8Q==","X-Gm-Gg":"AeBDietfjNQvCCUFwd3t5G+/oJ2xNLXfxQ3GkEVS2jomHG3pej3noDqdtmOZCeh3riC\n rMpFnjlfK/Ev4z5cS5kO1L5OwE97+RygshTTXv3acbOGxQbzuN7fX3noxAF942fAK3MFIE2uw3T\n AxB7G0pYO0/7QZyeOVK0XC8qBpC8yJf0oRtToAVRjRKf5ml0yhM4eJA5TnVsCga+Hb4Xlw1pjbx\n 5LRBv30ABV/e7Flly63ewkvwI3xi6v7iorHqm4niyby3Q+0t5mCI6scPRnrbxt+F5y/bNj9VekH\n rvanCgeJ","X-Received":"by 2002:a17:903:1aae:b0:2b2:4e1a:aff9 with SMTP id\n d9443c01a7336-2b2d5a95dc2mr161592235ad.44.1776140664509; Mon, 13 Apr 2026\n 21:24:24 -0700 (PDT)","MIME-Version":"1.0","References":"<20260412174334.3111385-1-wangrui@loongson.cn>\n <CAMe9rOoMtg1ejWOrqUgN3ke3Lv6-TT-wcKvJU49Vwsr+Q+o3kQ@mail.gmail.com>","In-Reply-To":"\n <CAMe9rOoMtg1ejWOrqUgN3ke3Lv6-TT-wcKvJU49Vwsr+Q+o3kQ@mail.gmail.com>","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","Date":"Tue, 14 Apr 2026 12:23:47 +0800","X-Gm-Features":"AQROBzB_4TFOKobujNLHy-N6y2yC_jqQt-xlEt99elkMWX5eBbRRM7xouvoAcW0","Message-ID":"\n <CAMe9rOpxRYMN3HZDkiG=EeVgzjq0GZAS-ss8V7OfFOdT3hNz1w@mail.gmail.com>","Subject":"Re: [PATCH v9 0/6] elf: THP-aware load segment alignment","To":"WANG Rui <wangrui@loongson.cn>","Cc":"libc-alpha@sourceware.org,\n Adhemerval Zanella <adhemerval.zanella@linaro.org>,\n Dev Jain <dev.jain@arm.com>,\n Florian Weimer <fweimer@redhat.com>, Wilco Dijkstra <Wilco.Dijkstra@arm.com>,\n Xi Ruoyao <xry111@xry111.site>, WANG Xuerui <git@xen0n.name>,\n caiyinyu <caiyinyu@loongson.cn>,\n mengqinggang <mengqinggang@loongson.cn>, Huacai Chen <chenhuacai@kernel.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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"}}]