lkml.org 
[lkml]   [2008]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: EMM: Fixup return value handling of emm_notify()
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.


\
 
 \ /
  Last update: 2008-04-02 23:27    [W:0.124 / U:1.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site