The specific rules are that arch_enter_lazy_mmu_mode()/arch_leave_lazy_mmu_mode() require you to be holding the appropriate pte locks for the ptes you're updating, so preemption is naturally disabled in that case.
Right, except on -rt where the pte lock is a mutex.
This all goes a bit strange with init_mm's non-requirement for taking pte locks. The caller has to arrange for some kind of serialization on updating the range in question, and that could be a mutex. Explicitly disabling preemption in enter_lazy_mmu_mode would make sense for this case, but it would be redundant for the common case of batched updates to usermode ptes.
I really utterly hate how you just plonk preempt_disable() in there
unconditionally and without very clear comments on how and why.
I'd rather we'd fix up the init_mm to also have a pte lock.Yes, I don't like the init_mm-exceptionalism either.