]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
/dev/zero: try to align PMD_SIZE for private mapping
authorZhang Qilong <zhangqilong3@huawei.com>
Thu, 31 Jul 2025 12:23:05 +0000 (20:23 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:54:42 +0000 (16:54 -0700)
commit849d5cff4d48be9146c2bf3c492fc7f434b5ffaa
tree89fd0f052b5e39e528235d3a11b96e987ff65fc6
parent337135e6124b6d37d7ef1cd5a6c0b9681938c5ee
/dev/zero: try to align PMD_SIZE for private mapping

Attempt to map aligned to huge page size for private mapping which could
achieve performance gains, the mprot_tw4m in libMicro average execution
time on arm64:

  - Test case:        mprot_tw4m
  - Before the patch:   22 us
  - After the patch:    17 us

If THP config is not set, we fall back to system page size mappings.

Link: https://lkml.kernel.org/r/20250731122305.2669090-1-zhangqilong3@huawei.com
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/char/mem.c