[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f889be0a-b96e-482d-be0b-57c9d81b824d@redhat.com>
Date: Tue, 10 Jun 2025 15:25:55 +0200
From: David Hildenbrand <david@...hat.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Dev Jain <dev.jain@....com>
Cc: akpm@...ux-foundation.org, catalin.marinas@....com, will@...nel.org,
Liam.Howlett@...cle.com, vbabka@...e.cz, rppt@...nel.org, surenb@...gle.com,
mhocko@...e.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
suzuki.poulose@....com, steven.price@....com, gshan@...hat.com,
linux-arm-kernel@...ts.infradead.org, yang@...amperecomputing.com,
ryan.roberts@....com, anshuman.khandual@....com
Subject: Re: [PATCH v2 1/2] mm: Allow lockless kernel pagetable walking
On 10.06.25 15:24, David Hildenbrand wrote:
> On 10.06.25 14:07, Lorenzo Stoakes wrote:
>> OK so I think the best solution here is to just update check_ops_valid(), which
>> was kind of sucky anyway (we check everywhere but walk_page_range_mm() to
>> enforce the install pte thing).
>>
>> Let's do something like:
>>
>> #define OPS_MAY_INSTALL_PTE (1<<0)
>> #define OPS_MAY_AVOID_LOCK (1<<1)
>>
>> and update check_ops_valid() to take a flags or maybe 'capabilities' field.
>>
>> Then check based on this e.g.:
>>
>> if (ops->install_pte && !(capabilities & OPS_MAY_INSTALL_PTE))
>> return false;
>>
>> if (ops->walk_lock == PGWALK_NOLOCK && !(capabilities & OPS_MAY_AVOID_LOCK))
>> return false;
>>
>
> Hm. I mean, we really only want to allow this lockless check for
> walk_kernel_page_table_range(), right?
>
> Having a walk_kernel_page_table_range_lockeless() might (or might not)
> be better, to really only special-case this specific path.
Note that I am also not quite happy bout that function name, but I think
we should add a proper interface that documents clearly when it is even
okay to call that function ...
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists