On Fri, Jul 20, 2018 at 11:32:39AM +0200, Peter Zijlstra wrote:
> + if (!next->mm) { // to kernel > + enter_lazy_tlb(prev->active_mm, next); > + > +#ifdef ARCH_NO_ACTIVE_MM > + next->active_mm = prev->active_mm; > + if (prev->mm) // from user > + mmgrab(prev->active_mm); else prev->active_mm = NULL; > +#endif > + } else { // to user > + switch_mm_irqs_off(prev->active_mm, next->mm, next); > + > +#ifdef ARCH_NO_ACTIVE_MM > + if (!prev->mm) { // from kernel > + /* will mmdrop() in finish_task_switch(). */ > + rq->prev_mm = prev->active_mm; > + prev->active_mm = NULL; > + } > +#endif > }