lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025073039-confront-harmony-621d@gregkh>
Date: Wed, 30 Jul 2025 06:28:51 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Zhang Qilong <zhangqilong3@...wei.com>
Cc: arnd@...db.de, linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	lorenzo.stoakes@...cle.com, wangkefeng.wang@...wei.com,
	sunnanyong@...wei.com
Subject: Re: [PATCH v2] /dev/zero: try to align PMD_SIZE for private mapping

On Wed, Jul 30, 2025 at 10:22:06AM +0800, Zhang Qilong wrote:
> If THP is enable, 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 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> index 48839958b0b1..3699e716b84e 100644
> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -525,12 +525,20 @@ static unsigned long get_unmapped_area_zero(struct file *file,
>  		 * so as not to confuse shmem with our handle on "/dev/zero".
>  		 */
>  		return shmem_get_unmapped_area(NULL, addr, len, pgoff, flags);
>  	}
>  
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> +	/*
> +	 * Attempt to map aligned to huge page size if possible, otherwise we
> +	 * fall back to system page size mappings in thp_get_unmapped_area.
> +	 */
> +	return thp_get_unmapped_area(file, addr, len, pgoff, flags);
> +#else
>  	/* Otherwise flags & MAP_PRIVATE: with no shmem object beneath it */
>  	return mm_get_unmapped_area(current->mm, file, addr, len, pgoff, flags);
> +#endif
>  #else
>  	return -ENOSYS;
>  #endif
>  }
>  
> -- 
> 2.43.0
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ