linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Liu Shixin <liushixin2@huawei.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Nanyong Sun <sunnanyong@huawei.com>,
	Muchun Song <muchun.song@linux.dev>,
	Qi Zheng <zhengqi.arch@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Yang Shi <yang@os.amperecomputing.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: khugepaged: fix call hpage_collapse_scan_file() for anonymous vma
Date: Fri, 10 Jan 2025 10:29:55 +0800	[thread overview]
Message-ID: <88b0740c-d038-0f4e-2a4b-792cb5b6cd8c@huawei.com> (raw)
In-Reply-To: <Z3_R2qWcvWxm6T83@casper.infradead.org>



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.


  reply	other threads:[~2025-01-10  2:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09  7:00 Liu Shixin
2025-01-09 13:40 ` Matthew Wilcox
2025-01-10  2:29   ` Liu Shixin [this message]
2025-01-09 17:00 ` Yang Shi
2025-01-10  2:08   ` Baolin Wang
2025-01-10  2:32   ` Liu Shixin
2025-01-10  4:31   ` Matthew Wilcox
2025-01-10 18:04     ` Yang Shi
2025-01-10 19:01       ` Matthew Wilcox
2025-01-10 19:40         ` Yang Shi
2025-01-11  3:54           ` Liu Shixin
2025-01-13 18:51             ` Yang Shi

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=88b0740c-d038-0f4e-2a4b-792cb5b6cd8c@huawei.com \
    --to=liushixin2@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=sunnanyong@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=yang@os.amperecomputing.com \
    --cc=zhengqi.arch@bytedance.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