Re: [PATCH v2 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

2019-08-21 Thread Michel Lespinasse
On Tue, Aug 13, 2019 at 05:06:16PM -0700, Davidlohr Bueso wrote: > On Tue, 02 Jul 2019, Michel Lespinasse wrote: > > - The majority of interval tree users (though either the > > interval_tree.h or the interval_tree_generic.h API) do not store any > > overlapping intervals, and as such they really d

Re: [PATCH v2 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

2019-08-13 Thread Davidlohr Bueso
On Tue, 02 Jul 2019, Michel Lespinasse wrote: Ehhh, I have my own list of gripes about interval tree (I'm responsible for some of these too): Sorry just getting back to this. - The majority of interval tree users (though either the interval_tree.h or the interval_tree_generic.h API) do not s

Re: [PATCH v2 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

2019-07-02 Thread Michel Lespinasse
On Tue, Jul 2, 2019 at 9:09 AM Davidlohr Bueso wrote: > > On Tue, 02 Jul 2019, Michel Lespinasse wrote: > > >diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c > >index fa16036fa592..2afad8e869fc 100644 > >--- a/arch/x86/mm/pat_rbtree.c > >+++ b/arch/x86/mm/pat_rbtree.c > >@@ -54,23

Re: [PATCH v2 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

2019-07-02 Thread Davidlohr Bueso
On Tue, 02 Jul 2019, Michel Lespinasse wrote: diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c index fa16036fa592..2afad8e869fc 100644 --- a/arch/x86/mm/pat_rbtree.c +++ b/arch/x86/mm/pat_rbtree.c @@ -54,23 +54,10 @@ static u64 get_subtree_max_end(struct rb_node *node) re

[PATCH v2 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro

2019-07-02 Thread Michel Lespinasse
Add RB_DECLARE_CALLBACKS_MAX, which generates augmented rbtree callbacks for the case where the augmented value is a scalar whose definition follows a max(f(node)) pattern. This actually covers all present uses of RB_DECLARE_CALLBACKS, and saves some (source) code duplication in the various RBCOMPU