All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Barry Song <21cnbao@gmail.com>
Cc: Lance Yang <lance.yang@linux.dev>,
	Vernon Yang <vernon2gm@gmail.com>,
	akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
	ziy@nvidia.com, dev.jain@arm.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Vernon Yang <yanglincheng@kylinos.cn>
Subject: Re: [PATCH mm-new v7 4/5] mm: khugepaged: skip lazy-free folios
Date: Sat, 7 Feb 2026 23:25:27 +0100	[thread overview]
Message-ID: <bfda8f27-cd2d-43dd-9fdc-cebf7b7cd7f8@kernel.org> (raw)
In-Reply-To: <CAGsJ_4zBpL6a5ORAQUFwZMM+ikmMS8JSo9enLDZ7VFT9kkge+A@mail.gmail.com>

On 2/7/26 23:17, Barry Song wrote:
> On Sun, Feb 8, 2026 at 6:05 AM David Hildenbrand (Arm) <david@kernel.org> wrote:
>>
>> On 2/7/26 23:01, Barry Song wrote:
>>>
>>> Maybe change “just not skip” to “just skip”?
>>>
>>> If the goal is to avoid the collapse overhead for folios that are
>>> about to be dropped, we might consider skipping collapse for the
>>> entire VMA?
>> If there is no memory pressure in the system, why wouldn't you just want
>> to collapse in a VM_DROPPABLE region?
>>
>> "about to be dropped" only applies once there is actual memory pressure.
>> If not, these pages stick around forever.
> 
>   agree. But this brings us back to the philosophy of the original patch.
> If there is no memory pressure, lazyfree folios won’t be dropped, so
> collapsing them might also be reasonable.

It's about memory pressure in the future.

> 
> Just collapsing fully lazyfree folios with VM_DROPPABLE while
> skipping partially lazyfree VMAs seems a bit confusing to me :-)

Think of it like this:

All folios in VM_DROPPABLE are lazyfree. Collapsing maintains that 
property. So you can just collapse and memory pressure in the future 
will free it up.

In contrast, collapsing in !VM_DROPPABLE does not maintain that 
property. The collapsed folio will not be lazyfree and memory pressure 
in the future will not be able to free it up.

-- 
Cheers,

David


  reply	other threads:[~2026-02-07 22:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07  8:16 [PATCH mm-new v7 0/5] Improve khugepaged scan logic Vernon Yang
2026-02-07  8:16 ` [PATCH mm-new v7 1/5] mm: khugepaged: add trace_mm_khugepaged_scan event Vernon Yang
2026-02-07  8:16 ` [PATCH mm-new v7 2/5] mm: khugepaged: refine scan progress number Vernon Yang
2026-02-08  9:17   ` Dev Jain
2026-02-08 13:25     ` Vernon Yang
2026-02-18  3:55   ` Vernon Yang
2026-02-18  8:05     ` David Hildenbrand (Arm)
2026-02-07  8:16 ` [PATCH mm-new v7 3/5] mm: add folio_test_lazyfree helper Vernon Yang
2026-02-07  8:16 ` [PATCH mm-new v7 4/5] mm: khugepaged: skip lazy-free folios Vernon Yang
2026-02-07  8:34   ` Barry Song
2026-02-07 13:51     ` Lance Yang
2026-02-07 21:38       ` David Hildenbrand (Arm)
2026-02-07 22:01         ` Barry Song
2026-02-07 22:05           ` David Hildenbrand (Arm)
2026-02-07 22:17             ` Barry Song
2026-02-07 22:25               ` David Hildenbrand (Arm) [this message]
2026-02-07 22:31                 ` Barry Song
2026-02-08 13:26                 ` Vernon Yang
2026-02-08  4:06         ` Lance Yang
2026-02-07  8:16 ` [PATCH mm-new v7 5/5] mm: khugepaged: set to next mm direct when mm has MMF_DISABLE_THP_COMPLETELY Vernon Yang
  -- strict thread matches above, loose matches on Subject: below --
2026-02-07  8:11 [PATCH mm-new v7 0/5] Improve khugepaged scan logic Vernon Yang
2026-02-07  8:11 ` [PATCH mm-new v7 4/5] mm: khugepaged: skip lazy-free folios Vernon Yang

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=bfda8f27-cd2d-43dd-9fdc-cebf7b7cd7f8@kernel.org \
    --to=david@kernel.org \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=vernon2gm@gmail.com \
    --cc=yanglincheng@kylinos.cn \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.