[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231103231254.bytltpzsc2qojlbw@sarkhan>
Date: Fri, 3 Nov 2023 23:12:58 +0000
From: Daniel Gomez <da.gomez@...sung.com>
To: Matthew Wilcox <willy@...radead.org>
CC: "minchan@...nel.org" <minchan@...nel.org>,
"senozhatsky@...omium.org" <senozhatsky@...omium.org>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"djwong@...nel.org" <djwong@...nel.org>,
"hughd@...gle.com" <hughd@...gle.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"mcgrof@...nel.org" <mcgrof@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"gost.dev@...sung.com" <gost.dev@...sung.com>,
Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [RFC PATCH 01/11] XArray: add cmpxchg order test
On Sun, Oct 29, 2023 at 08:11:32PM +0000, Matthew Wilcox wrote:
> On Sat, Oct 28, 2023 at 09:15:35PM +0000, Daniel Gomez wrote:
> > +static noinline void check_cmpxchg_order(struct xarray *xa)
> > +{
> > + void *FIVE = xa_mk_value(5);
> > + unsigned int order = IS_ENABLED(CONFIG_XARRAY_MULTI) ? 15 : 1;
>
> ... have you tried this with CONFIG_XARRAY_MULTI deselected?
> I suspect it will BUG() because orders greater than 0 are not allowed.
>
> > + XA_BUG_ON(xa, !xa_empty(xa));
> > + XA_BUG_ON(xa, xa_store_index(xa, 5, GFP_KERNEL) != NULL);
> > + XA_BUG_ON(xa, xa_insert(xa, 5, FIVE, GFP_KERNEL) != -EBUSY);
> > + XA_BUG_ON(xa, xa_store_order(xa, 5, order, FIVE, GFP_KERNEL));
> > + XA_BUG_ON(xa, xa_get_order(xa, 5) != order);
> > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(FIVE)) != order);
> > + old = xa_cmpxchg(xa, 5, FIVE, NULL, GFP_KERNEL);
> > + XA_BUG_ON(xa, old != FIVE);
> > + XA_BUG_ON(xa, xa_get_order(xa, 5) != 0);
> > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(FIVE)) != 0);
> > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(old)) != 0);
> > + XA_BUG_ON(xa, !xa_empty(xa));
>
> I'm not sure this is a great test. It definitely does do what you claim
> it will, but for example, it's possible that we might keep that
> information for other orders. So maybe we should have another entry at
> (1 << order) that keeps the node around and could theoretically keep
> the order information around for the now-NULL entry?
Thanks Matthew for the review. I'm sending a separate patch with the
fixes and improvements on the XArray cmpxchg test.
Powered by blists - more mailing lists