Re: [PATCH] trace: Set oom_score_adj to maximum for ring bufferallocating process

From: David Rientjes
Date: Thu May 26 2011 - 16:22:34 EST


On Thu, 26 May 2011, Steven Rostedt wrote:

> Hmm, have you tried this in practice? Yes we may kill the "echo" command
> but it doesn't stop the ring buffer from being allocated, and thus
> killing the echo command may not be enough, and those critical processes
> that you are trying to protect will be killed next.
>
> Perhaps we should change the allocation of the ring buffer or detect OOM
> triggering. Maybe make all the allocations ATOMIC, thus it will be
> either available or not, and fail instead of trying to swap out other
> memory for the allocation.
>

My impression of this was that it was attempting to avoid killing a
different process by means of the oom killer rather than avoiding swap. I
don't think there's anything wrong with using GFP_KERNEL, but I'd suggest
also using __GFP_NORETRY so the allocation calls into direct reclaim but
will avoid oom killing anything and simply failing instead.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/