[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c821e8c-1d9e-46ca-b0ab-3a897878d883@redhat.com>
Date: Tue, 29 Jul 2025 15:58:00 +0200
From: David Hildenbrand <david@...hat.com>
To: Zhang Qilong <zhangqilong3@...wei.com>, arnd@...db.de,
gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
wangkefeng.wang@...wei.com, sunnanyong@...wei.com,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Subject: Re: [PATCH] /dev/zero: try to align PMD_SIZE for private mapping
On 29.07.25 15:49, Zhang Qilong wrote:
> By default, THP are usually enabled. Mapping /dev/zero with a size
> larger than 2MB could achieve performance gains by allocating aligned
> address. The mprot_tw4m in libMicro average execution time on arm64:
> - Test case: mprot_tw4m
> - Before the patch: 22 us
> - After the patch: 17 us
>
> Signed-off-by: Zhang Qilong <zhangqilong3@...wei.com>
> ---
> drivers/char/mem.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> index 48839958b0b1..c57327ca9dd6 100644
> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -515,10 +515,12 @@ static int mmap_zero(struct file *file, struct vm_area_struct *vma)
> static unsigned long get_unmapped_area_zero(struct file *file,
> unsigned long addr, unsigned long len,
> unsigned long pgoff, unsigned long flags)
> {
> #ifdef CONFIG_MMU
> + unsigned long ret;
Can we call that "addr" like we do in __get_unmapped_area()?
Nothing else jumped at me ... so I assume this is fine?
CCing mmap-man Lorenzo.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists