From: David Hildenbrand <david@redhat.com>
To: Zhang Qilong <zhangqilong3@huawei.com>,
arnd@arndb.de, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
wangkefeng.wang@huawei.com, sunnanyong@huawei.com,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Subject: Re: [PATCH] /dev/zero: try to align PMD_SIZE for private mapping
Date: Tue, 29 Jul 2025 15:58:00 +0200 [thread overview]
Message-ID: <1c821e8c-1d9e-46ca-b0ab-3a897878d883@redhat.com> (raw)
In-Reply-To: <20250729134942.900517-1-zhangqilong3@huawei.com>
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@huawei.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
next prev parent reply other threads:[~2025-07-29 13:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 13:49 Zhang Qilong
2025-07-29 13:58 ` David Hildenbrand [this message]
2025-07-29 15:48 ` Lorenzo Stoakes
2025-07-30 3:36 ` kernel test robot
2025-07-30 2:00 zhangqilong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c821e8c-1d9e-46ca-b0ab-3a897878d883@redhat.com \
--to=david@redhat.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=sunnanyong@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=zhangqilong3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox