That first threshold sounds fine yes. To me, the second mostly sounds like a
job for SIGTERM though.
The OOM killer could after it selected the task for killing first try a TERM
on it to give a chance to exit gracefully and only when that doesn't help
make it eligible for killing on a second round through the badness calculation.
You could moreover _never_ make a task eligible for killing before it
received a SIGTERM, thereby guaranteeing that everyone got the SIGTERM
before killing anything, and it seems SIGTERM would be a more focussed
version of SIGDANGER2 then.
Would at least forego any need for multiplexing the DANGER signal.
Rene.
-