Followup question is: If this is not the correct way of working (which means
I misunderstood something sometime ? ), how should it work?
What you describe is correct and all fine, this is probably something that
didn't matter much some years ago but now is causing confusion (at least
confusing me).
I see pmap_activate(l) does basically two things:
- fiddle with the PCB of l (this is the part needed in the call that I
want to remove)
- if l == curlwp also switch the CPU to this pmap
I think (but I am not sure) in modern semantics pmap_activate() should only
do the l == curlwp part (and probably uncoditionally), and the first part
should be moved elsewhere (that could be inline into the call I was trying
to remove) and only be done once at lwp creation time.
I tried to understand how it should work, but it is not clear to me
either :-)