Re: [RFC] simple_lmk: Introduce Simple Low Memory Killer for Android

From: Steven Rostedt
Date: Thu Mar 14 2019 - 23:16:53 EST


On Thu, 14 Mar 2019 13:49:11 -0700
Sultan Alsawaf <sultan@xxxxxxxxxxxxxxx> wrote:

> Perhaps I'm missing something, but if you want to know when a process has died
> after sending a SIGKILL to it, then why not just make the SIGKILL optionally
> block until the process has died completely? It'd be rather trivial to just
> store a pointer to an onstack completion inside the victim process' task_struct,
> and then complete it in free_task().

How would you implement such a method in userspace? kill() doesn't take
any parameters but the pid of the process you want to send a signal to,
and the signal to send. This would require a new system call, and be
quite a bit of work. If you can solve this with an ebpf program, I
strongly suggest you do that instead.

-- Steve