[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f8d6f3f-f98b-4f90-95d5-f4a09d61c88a@redhat.com>
Date: Wed, 2 Jul 2025 16:40:30 +0200
From: David Hildenbrand <david@...hat.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>, Zi Yan <ziy@...dia.com>,
Matthew Brost <matthew.brost@...el.com>,
Joshua Hahn <joshua.hahnjy@...il.com>, Rakie Kim <rakie.kim@...com>,
Byungchul Park <byungchul@...com>, Gregory Price <gourry@...rry.net>,
Ying Huang <ying.huang@...ux.alibaba.com>,
Alistair Popple <apopple@...dia.com>, Pedro Falcato <pfalcato@...e.de>,
Rik van Riel <riel@...riel.com>, Harry Yoo <harry.yoo@...cle.com>,
Lance Yang <ioworker0@...il.com>
Subject: Re: [PATCH v2 4/4] mm: remove boolean output parameters from
folio_pte_batch_ext()
On 02.07.25 16:00, Oscar Salvador wrote:
> On Wed, Jul 02, 2025 at 12:49:26PM +0200, David Hildenbrand wrote:
>> Instead, let's just allow for specifying through flags whether we want
>> to have bits merged into the original PTE.
>>
>> For the madvise() case, simplify by having only a single parameter for
>> merging young+dirty. For madvise_cold_or_pageout_pte_range() merging the
>> dirty bit is not required, but also not harmful. This code is not that
>> performance critical after all to really force all micro-optimizations.
>
> Seems a bit odd to me to have the dirty-young bit being treat as "one".
> You mention that this is done because the only user of it doesn't really
> care about dirty vs non-dirty and it's not harmful eitherway, so micro-optimizing
> this isn't worth at this moment.
>
> But what if we grop another user which wants to make this distinction and
> where it matters dirty vs non-dirty/young vs not-young.
> Wouldn't be better to have it separated from the start?
I mean, it's easy to add later if ever required. :)
But more importantly, usually young+dirty is a moving target as HW can
usually update it asynchronously.
So in the common case, you really have to rely on the young+dirty bits
from get_and_clear_full_ptes(), and not on the current snapshot while
the page remains mapped.
The madvise() use case is rather special in that sense.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists