Re: [PATCH v3] mm: process_mrelease: introduce PROCESS_MRELEASE_REAP_KILL flag
From: Oleg Nesterov
Date: Fri May 15 2026 - 12:31:04 EST
On 05/15, Christian Brauner wrote:
>
> Right now we have clear and simple signal sending semantics for pidfds:
>
> * thread-specific pidfd -> thread-directed signal (unless signal is thread-group scoped by default)
> * thread-group pidfd -> thread-group directed signal
I don't even understand why this patch uses pidfd to send SIGKILL...
> > + reap = reap_kill || task_will_free_mem(p);
> > + if (!reap) {
> > /* Error only if the work has not been done already */
> > if (!mm_flags_test(MMF_OOM_SKIP, mm))
> > ret = -EINVAL;
> > + task_unlock(p);
> > + goto put_task;
> > }
> > +
> > + mmgrab(mm);
> > task_unlock(p);
> >
> > - if (!reap)
> > - goto drop_mm;
> > + if (reap_kill) {
> > + ret = kill_all_shared_mm(task, mm);
If task_will_free_mem() above succeeded, we do not need to call
kill_all_shared_mm() ?
Oleg.