[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220712154401.hh5ibuw7d3qlrd4r@revolver>
Date: Tue, 12 Jul 2022 15:44:09 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
CC: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] maple_tree: Fix sparse reported issues
* Matthew Wilcox <willy@...radead.org> [220712 10:54]:
> On Tue, Jul 12, 2022 at 02:24:55PM +0000, Liam Howlett wrote:
> > When building with C=1, the maple tree had some rcu type mismatch &
> > locking mismatches in the destroy functions. There were cosmetic only
> > since this happens after the nodes are removed from the tree.
>
> ... in the current use-case. It's a legitimate use of the API to do:
>
> ma_init();
> ma_store();
> ma_destroy();
> ma_store();
>
> Can you add a new test that does that?
I can add this, but a few notes on it.
The function names are mt_init(), mtree_store(), and mtree_destroy().
There is an internal/advanced __mt_destroy(). Both destroy functions
clear the flags - which I think is desirable.
>
> > @@ -5524,13 +5526,17 @@ static void mt_destroy_walk(struct maple_enode *enode, unsigned char ma_flags,
> >
> > type = mte_node_type(mas.node);
> > slots = ma_slots(mte_to_node(mas.node), type);
> > - if ((offset < mt_slots[type]) && mte_node_type(slots[offset]) &&
> > - mte_to_node(slots[offset])) {
> > - struct maple_enode *parent = mas.node;
> > + if (offset >= mt_slots[type])
> > + goto next;
> >
> > - mas.node = mas_slot_locked(&mas, slots, offset);
> > + tmp = mas_slot_locked(&mas, slots, offset);
> > + if (mte_node_type(tmp) && mte_to_node(tmp)) {
> > +
>
> Unnecessary blank line?
ack, I'll remove that.
>
> > + parent = mas.node;
> > + mas.node = tmp;
> > slots = mas_destroy_descend(&mas, parent, offset);
> > }
> > +next:
> > node = mas_mn(&mas);
> > } while (start != mas.node);
> >
> > --
> > 2.35.1
> >
>
> --
> maple-tree mailing list
> maple-tree@...ts.infradead.org
> https://lists.infradead.org/mailman/listinfo/maple-tree
Powered by blists - more mailing lists