On Thu, Apr 06, 2023 at 09:53:37AM -0700, Stefan Roesch wrote: > + case PR_SET_MEMORY_MERGE: > + if (mmap_write_lock_killable(me->mm)) > + return -EINTR; > + > + if (arg2) { > + int err = ksm_add_mm(me->mm); > + if (err) > + return err; You'll return to userspace with the mutex held, no?