mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Baolin Wang <baolin.wang@linux.alibaba.com>,
	Lance Yang <lance.yang@linux.dev>, Barry Song <baohua@kernel.org>
Cc: akpm@linux-foundation.org, ljs@kernel.org, riel@surriel.com,
	liam@infradead.org, vbabka@kernel.org, harry@kernel.org,
	jannh@google.com, qi.zheng@linux.dev, pfalcato@suse.de,
	ayushr@modal.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: synchronize with PTE table reclaim for all folio sizes
Date: Thu, 5 Nov 2026 11:06:29 +0100	[thread overview]
Message-ID: <8ebb182b-8a01-4d32-8c76-7e4bd9e54ddb@kernel.org> (raw)
In-Reply-To: <f7bd740e-1328-473e-96f5-89658a08d514@linux.alibaba.com>

On 11/5/26 10:00, Baolin Wang wrote:
> CC Barry, who added the TTU_SYNC in shrink_folio_list().
> 
> On 11/5/26 1:48 PM, Lance Yang wrote:
>>
>>
>> On 2026/11/5 12:54, Lance Yang wrote:
>>>
>>>
>>> Good catch!
>>>
>>>
>>> Right. Whether the folio can be PMD-mapped doesn't tell us whether its
>>> PTE table can be reclaimed, so those extra checks can skip synchronization
>>> that the caller explicitly asked for ;)
>>
>> Ouch ... one thing I missed ... what about order-0 reclaim?
>>
>> shrink_folio_list() only sets TTU_SYNC for large folio, so can't we still
>> hit the same race there?
> 
> Thanks Lance. But this matches the purpose of the TTU_SYNC flag, which is used
> to avoid racy checks with PVMW_SYNC. If no TTU_SYNC flag is set, it means the
> caller can tolerate some racy checks.
> 
> For this case, I think we should set TTU_SYNC unconditionally in
> shrink_folio_list(). Barry, what do you think?

That makes sense. I hope this doesn't throw a big wrench into our reclaim
performance numbers.

Can someone benchmark this?

But maybe we should really follow-up with the folio-size based optimization in
sync_with_folio_pmd_zap(), where we only need a memory barrier (and sufficient
documentation why something that cannot be PMD-mapped can get away cheaper).

-- 
Cheers,

David

  reply	other threads:[~2026-11-05 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  2:56 Baolin Wang
2026-11-05  3:22 ` Qi Zheng
2026-11-05  4:54 ` Lance Yang
2026-11-05  5:48   ` Lance Yang
2026-11-05  9:00     ` Baolin Wang
2026-11-05 10:06       ` David Hildenbrand (Arm) [this message]
2026-11-05 11:18         ` Baolin Wang
2026-11-05 13:22         ` Lance Yang
2026-11-05 11:37 ` Pedro Falcato

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=8ebb182b-8a01-4d32-8c76-7e4bd9e54ddb@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ayushr@modal.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=harry@kernel.org \
    --cc=jannh@google.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=pfalcato@suse.de \
    --cc=qi.zheng@linux.dev \
    --cc=riel@surriel.com \
    --cc=vbabka@kernel.org \
    /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

all inboxes | Powered by JetHome®