[PATCH v3 1/6] set_memory: add number of pages parameter to set_direct_map APIs
David Hildenbrand (Arm)
david at kernel.org
Tue Sep 8 04:53:20 PDT 2026
>> 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 ;)
>
>> 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
More information about the linux-riscv
mailing list