Thread (17 messages) 17 messages, 4 authors, 2025-06-11

Re: [PATCH v2 1/2] mm: Allow lockless kernel pagetable walking

From: Lorenzo Stoakes <hidden>
Date: 2025-06-10 13:27:24
Also in: linux-mm, lkml

On Tue, Jun 10, 2025 at 03:24:16PM +0200, David Hildenbrand wrote:
On 10.06.25 14:07, Lorenzo Stoakes wrote:
quoted
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.
Agree completely, Dev - let's definitely do this.
So, I am wondering if we should further start splitting the
kernel-page-table walker up from the mm walker, at least on the "entry"
function for now.
How do you mean?
--
Cheers,

David / dhildenb
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help