[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJ5Xa/4ZFEgfdsOY@hirez.programming.kicks-ass.net>
Date: Fri, 14 May 2021 12:56:43 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Liam Howlett <liam.howlett@...cle.com>
Cc: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Song Liu <songliubraving@...com>,
Davidlohr Bueso <dave@...olabs.net>,
"Paul E . McKenney" <paulmck@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Laurent Dufour <ldufour@...ux.ibm.com>,
David Rientjes <rientjes@...gle.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>,
Rik van Riel <riel@...riel.com>,
Michel Lespinasse <walken.cr@...il.com>
Subject: Re: [PATCH 26/94] Maple Tree: Add new data structure
Cc'ing a moderated list is sodding annoying, dropped it.
On Wed, Apr 28, 2021 at 03:36:02PM +0000, Liam Howlett wrote:
> +struct maple_range_64 {
> + struct maple_pnode *parent;
> + unsigned long pivot[MAPLE_RANGE64_SLOTS - 1];
> + void __rcu *slot[MAPLE_RANGE64_SLOTS];
> +};
> +
> +struct maple_arange_64 {
> + struct maple_pnode *parent;
> + unsigned long pivot[MAPLE_ARANGE64_SLOTS - 1];
> + void __rcu *slot[MAPLE_ARANGE64_SLOTS];
> + unsigned long gap[MAPLE_ARANGE64_SLOTS];
> + unsigned char meta;
> +};
> +
> +struct maple_alloc {
> + unsigned long total;
> + unsigned char node_count;
> + unsigned int request_count;
> + struct maple_alloc *slot[MAPLE_ALLOC_SLOTS];
> +};
> +
> +struct maple_topiary {
> + struct maple_pnode *parent;
> + struct maple_enode *next; /* Overlaps the pivot */
> +};
> +
> +enum maple_type {
> + maple_dense,
> + maple_leaf_64,
> + maple_range_64,
> + maple_arange_64,
> +};
> +struct maple_node {
> + union {
> + struct {
> + struct maple_pnode *parent;
> + void __rcu *slot[MAPLE_NODE_SLOTS];
> + };
> + struct {
> + void *pad;
> + struct rcu_head rcu;
> + unsigned int ma_flags;
> + enum maple_type type;
> + };
> + struct maple_range_64 mr64;
> + struct maple_arange_64 ma64;
> + struct maple_alloc alloc;
> + };
> +};
This is somewhat inconsistent; would it make sense to have struct
maple_dense and struct maple_leaf_64, and maybe even struct maple_free,
such that one can write:
struct maple_node {
union {
/* maple_type: */
struct maple_dense md;
struct maple_leaf_64 ml64;
struct maple_range_64 mr64;
struct maple_arange_64 ma64;
/* internal, life-time: */
struct maple_alloc alloc;
struct maple_free free;
};
};
Or something along those lines.
Powered by blists - more mailing lists