Re: [kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-03 Thread Peter Zijlstra
On Wed, 2008-04-02 at 14:33 -0700, Christoph Lameter wrote: On Wed, 2 Apr 2008, Andrea Arcangeli wrote: 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

Re: [kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-03 Thread Andrea Arcangeli
On Thu, Apr 03, 2008 at 12:40:46PM +0200, Peter Zijlstra wrote: It seems to me that common code can be shared using functions? No need FWIW I prefer separate methods. kvm patch using mmu notifiers shares 99% of the code too between the two different methods implemented indeed. Code sharing is

Re: [kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-03 Thread Christoph Lameter
On Thu, 3 Apr 2008, Peter Zijlstra wrote: It seems to me that common code can be shared using functions? No need to stuff everything into a single function. We have method vectors all over the kernel, we could do a_ops as a single callback too, but we dont. FWIW I prefer separate methods.

[kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-02 Thread Christoph Lameter
On Wed, 2 Apr 2008, Christoph Lameter wrote: Here f.e. We can add a special emm_age() function that iterates differently and does the | for you. Well maybe not really necessary. How about this fix? Its likely a problem to stop callbacks if one callback returned an error. Subject: EMM:

Re: [kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-02 Thread Andrea Arcangeli
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

Re: [kvm-devel] EMM: Fixup return value handling of emm_notify()

2008-04-02 Thread Christoph Lameter
On Wed, 2 Apr 2008, Andrea Arcangeli wrote: 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. The EMM API with a single callback is