linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Wei Yang <richard.weiyang@gmail.com>,
	"David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>, Bijan Tabatabai <bijan311@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
	Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org,
	surenb@google.com, mhocko@suse.com, shivankg@amd.com,
	Hugh Dickins <hughd@google.com>, Chris Li <chrisl@kernel.org>,
	Kairui Song <kasong@tencent.com>
Subject: Re: [PATCH] mm: Consider non-anon swap cache folios in folio_expected_ref_count()
Date: Fri, 19 Dec 2025 09:42:20 +0800	[thread overview]
Message-ID: <f0c962cf-20db-4ca8-897c-b64a5976bb89@linux.alibaba.com> (raw)
In-Reply-To: <20251219002134.uqgtnr43zz7vvvtd@master>



On 2025/12/19 08:21, Wei Yang wrote:
> On Wed, Dec 17, 2025 at 02:04:16AM +0100, David Hildenbrand (Red Hat) wrote:
>>>>>
>>>>> I am not very familiar with the memory hot-(un)plug or swapping code, so
>>>>> I am not 100% certain if this patch actually solves the root of the
>>>>> problem. I believe the issue is from shmem folios, in which case I believe
>>>>> this patch is correct. However, I couldn't think of an easy way to confirm
>>>>> that the affected folios were from shmem. I guess it could be possible that
>>>>> the root cause could be from some bug where some anonymous pages do not
>>>>> return true to folio_test_anon(). I don't think that's the case, but
>>>>> figured the MM maintainers would have a better idea of what's going on.
>>>
>>> I am not sure about if shmem in swapcache causes the issue, since
>>> the above setup does not involve shmem. +Baolin and Hugh for some insight.
>>
>> We might just push out another unrelated shmem page to swap as we create
>> memory pressure in the system I think.
>>
> 
> One trivial question: currently we only put anon/shmem folio in swapcache,
> right?

AFAICT, Yes (note a special case for anonymous folios: lazyfree 
anonymous folios will be directly freed instead of being swapped out).


  reply	other threads:[~2025-12-19  1:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16 20:07 Bijan Tabatabai
2025-12-17  0:07 ` David Hildenbrand (Red Hat)
2025-12-17  0:34   ` Zi Yan
2025-12-17  1:04     ` David Hildenbrand (Red Hat)
2025-12-17  3:09       ` Baolin Wang
2025-12-19  0:21       ` Wei Yang
2025-12-19  1:42         ` Baolin Wang [this message]
2025-12-19  2:35         ` Kairui Song
2025-12-20  0:47           ` Wei Yang
2025-12-17  6:04     ` Kairui Song

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=f0c962cf-20db-4ca8-897c-b64a5976bb89@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=bijan311@gmail.com \
    --cc=chrisl@kernel.org \
    --cc=david@kernel.org \
    --cc=hughd@google.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=richard.weiyang@gmail.com \
    --cc=rppt@kernel.org \
    --cc=shivankg@amd.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.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