Thread (27 messages) flat view 27 messages, 5 authors, 1d ago

Re: [PATCH v3 1/6] set_memory: add number of pages parameter to set_direct_map APIs

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-09-08 11:53:52
Also in: linux-arm-kernel, linux-mm, linux-riscv, linux-s390, lkml, loongarch

quoted
I'd assume such a case cannot currently get triggered, but there is no
documentation on what's supported and what's not. Or is there?

Imagine someone performing an update on an area that partially spans two PMDs.
While splitting and updating the first PMD could succeed, splitting the second
PMD could fail. What would be the end result? Rollback? Does the caller have to
clean up?
There is no rollback in any of set_memory implementations. It's up to the
callers to cleanup the mess afterwards.
Good to know, let's document that ;)
 
quoted
I'd appreciate if we could add proper documentation with expected semantics.
I believe it's more in the scope of  "arch, mm: create a generic
set_memory/change_page_attr core" [1] work than this patchset.

I can write (or maybe even slop ;) ) a doc about set_memory/set_direct_map,
I prefer well minimal and accurate docs ;) Who knows, maybe we'll even realize
while writing the docs that some semantics are weird and should be changed (some
architecture implementations adjusted to not be weird).

(I'm pretty sure we'll do, so schlop is not a good idea)
but I wouldn't want to hold this because there's not set_memory
documentation.
I'm fine with documenting it separately, but we *really* should start
documenting the semantics as we touch+cleanup this mess.

-- 
Cheers,

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