Re: [PATCH 14/14] mm: oom_kill: use IS_ERR() instead of strictchecking

From: David Rientjes
Date: Mon Sep 06 2010 - 04:59:48 EST


On Mon, 6 Sep 2010, KOSAKI Motohiro wrote:

> > From: Vasiliy Kulikov <segooon@xxxxxxxxx>
> >
> > Use IS_ERR() instead of strict checking.
>
> Umm...
>
> I don't like this. IS_ERR() imply an argument is error code. but in
> this case, we don't use error code. -1 mean oom special purpose meaning
> value.
>

You could make the same argument by saying the current use of PTR_ERR()
implies an error code. We've simply hijacked -1UL for simplicity in this
case and because select_bad_process() can only return one other value
besides a pointer to a process or NULL.

> So, if we take this direction, It would be better to use EAGAIN or something
> instead -1.
>

I agree it would probably better to return ERR_PTR(-EAGAIN) instead of
using -1UL.
--
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/