On Tue, Dec 21, 2021 at 05:19:00PM +0000, Peter Oskolkov wrote: > On Tue, Dec 14, 2021 at 09:44:48PM +0100, Peter Zijlstra wrote: > > +static struct task_struct *umcg_get_task(u32 tid) > > +{ > > + struct task_struct *tsk = NULL; > > + > > + if (tid) { > > + rcu_read_lock(); > > + tsk = find_task_by_vpid(tid); > > + if (tsk && current->mm == tsk->mm && tsk->umcg_task) > > This essentially limits all operations to a single mm/process. > Fine for now, but a fast remote context switch is also a valid use > case. It is not directly related to userspace scheduling, so I'm > just mentioning it here. Maybe server-to-server cross-process > context switches should be allowed for the same user/cgroup? (Again, > this is for later to consider). Doing cross-address-space UMCG will be a massive effort, too much (pretty much everything) in this implementation assumes things are directly addressable. > > + get_task_struct(tsk); > > + else > > + tsk = NULL; > > + rcu_read_unlock(); > > + } > > + > > + return tsk; > > +}