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] [thread-next>] [day] [month] [year] [list]
Message-ID: <88b0740c-d038-0f4e-2a4b-792cb5b6cd8c@huawei.com>
Date: Fri, 10 Jan 2025 10:29:55 +0800
From: Liu Shixin <liushixin2@...wei.com>
To: Matthew Wilcox <willy@...radead.org>
CC: Andrew Morton <akpm@...ux-foundation.org>, Chengming Zhou
	<chengming.zhou@...ux.dev>, Kefeng Wang <wangkefeng.wang@...wei.com>, Nanyong
 Sun <sunnanyong@...wei.com>, Muchun Song <muchun.song@...ux.dev>, Qi Zheng
	<zhengqi.arch@...edance.com>, Johannes Weiner <hannes@...xchg.org>, Yang Shi
	<yang@...amperecomputing.com>, <linux-mm@...ck.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: khugepaged: fix call hpage_collapse_scan_file() for
 anonymous vma



On 2025/1/9 21:40, Matthew Wilcox wrote:
> On Thu, Jan 09, 2025 at 03:00:59PM +0800, Liu Shixin wrote:
>> Add vma_is_anonymous() check to make such vma be processed by
>> hpage_collapse_scan_pmd().
> Wouldn't it be better to replace the vm_file check with
> vma_is_anonymous()?  ie:
>
>> -			if (IS_ENABLED(CONFIG_SHMEM) && vma->vm_file) {
>> +			if (IS_ENABLED(CONFIG_SHMEM) && vma->vm_file &&
>> +			    !vma_is_anonymous(vma)) {
> +			if (IS_ENABLED(CONFIG_SHMEM) &&
> +			    !vma_is_anonymous(vma)) {
>
>
> .
>
Thanks, replace is better.

Yang Shi suggest me to set vm_file to NULL when mmap /dev/zero as private.
It seems only /dev/zero is special which has vm_file but no vm_ops.
This way may solve more hidden similar problems, so I prefer it now.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ