Re: EMM: Fixup return value handling of emm_notify()

From: Andrea Arcangeli
Date: Wed Apr 02 2008 - 17:25:33 EST


On Wed, Apr 02, 2008 at 12:03:50PM -0700, Christoph Lameter wrote:
> + /*
> + * Callback may return a positive value to indicate a count
> + * or a negative error code. We keep the first error code
> + * but continue to perform callbacks to other subscribed
> + * subsystems.
> + */
> + if (x && result >= 0) {
> + if (x >= 0)
> + result += x;
> + else
> + result = x;
> + }
> }
> +

Now think of when one of the kernel janitors will micro-optimize
PG_dirty to be returned by invalidate_page so a single set_page_dirty
will be invoked... Keep in mind this is a kernel internal APIs, ask
Greg if we can change it in order to optimize later in the future. I
think my #v9 is optimal enough while being simple at the same time,
but anyway it's silly to be hardwired to such an interface that worst
of all requires switch statements instead of proper pointer to
functions and a fixed set of parameters and retval semantics for all
methods.
--
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/