public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@mellanox.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@mellanox.com>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: build failure after merge of the xarray tree
Date: Mon, 11 Mar 2019 12:46:33 +0000	[thread overview]
Message-ID: <20190311124630.GG32625@mtr-leonro.mtl.com> (raw)
In-Reply-To: <20190311024434.GA19508@bombadil.infradead.org>

On Sun, Mar 10, 2019 at 07:44:34PM -0700, Matthew Wilcox wrote:
> On Thu, Feb 21, 2019 at 12:34:42PM +0000, Leon Romanovsky wrote:
> > On Thu, Feb 21, 2019 at 05:13:32PM +1100, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > After merging the xarray tree, today's linux-next build (powerpc
> > > ppc64_defconfig) failed like this:
>
> [API change]
>
> So I ended up being really busy last week and not having time to send
> my merge request for XArray yet.  I'm going to send a request this week;
> Leon and Jason, how does this merge resolution look?
>
> Compile tested only.
>
> diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> index a9f29156e486..8a93c0c95953 100644
> --- a/drivers/infiniband/core/device.c
> +++ b/drivers/infiniband/core/device.c
> @@ -668,19 +668,10 @@ static int assign_name(struct ib_device *device, const char *name)
>  	}
>  	strlcpy(device->name, dev_name(&device->dev), IB_DEVICE_NAME_MAX);
>
> -	/* Cyclically allocate a user visible ID for the device */
> -	device->index = last_id;
> -	ret = xa_alloc(&devices, &device->index, INT_MAX, device, GFP_KERNEL);
> -	if (ret == -ENOSPC) {
> -		device->index = 0;
> -		ret = xa_alloc(&devices, &device->index, INT_MAX, device,
> -			       GFP_KERNEL);
> -	}
> -	if (ret)
> -		goto out;
> -	last_id = device->index + 1;
> -
> -	ret = 0;
> +	ret = xa_alloc_cyclic(&devices, &device->index, device, xa_limit_31b,
> +			&last_id, GFP_KERNEL);
> +	if (ret > 0)
> +		ret = 0;
>
>  out:
>  	up_write(&devices_rwsem);
> @@ -1059,14 +1050,14 @@ static int assign_client_id(struct ib_client *client)
>  	 * to get the LIFO order. The extra linked list can go away if xarray
>  	 * learns to reverse iterate.
>  	 */
> -	if (list_empty(&client_list))
> +	if (list_empty(&client_list)) {
>  		client->client_id = 0;
> -	else
> -		client->client_id =
> -			list_last_entry(&client_list, struct ib_client, list)
> -				->client_id;
> -	ret = xa_alloc(&clients, &client->client_id, INT_MAX, client,
> -		       GFP_KERNEL);
> +	} else {
> +		struct ib_client *last = list_last_entry(&client_list,
> +				struct ib_client, list);
> +		client->client_id = last->client_id + 1;
> +	}
> +	ret = xa_insert(&clients, client->client_id, client, GFP_KERNEL);
>  	if (ret)
>  		goto out;
>
> diff --git a/drivers/infiniband/core/restrack.c b/drivers/infiniband/core/restrack.c
> index fa804093fafb..3b5ff2f7b5f8 100644
> --- a/drivers/infiniband/core/restrack.c
> +++ b/drivers/infiniband/core/restrack.c
> @@ -13,28 +13,6 @@
>  #include "cma_priv.h"
>  #include "restrack.h"
>
> -static int rt_xa_alloc_cyclic(struct xarray *xa, u32 *id, void *entry,
> -			      u32 *next)
> -{
> -	int err;
> -
> -	*id = *next;
> -	if (*next == U32_MAX)
> -		*id = 0;
> -
> -	xa_lock(xa);
> -	err = __xa_alloc(xa, id, U32_MAX, entry, GFP_KERNEL);
> -	if (err && *next != U32_MAX) {
> -		*id = 0;
> -		err = __xa_alloc(xa, id, *next, entry, GFP_KERNEL);
> -	}
> -
> -	if (!err)
> -		*next = *id + 1;
> -	xa_unlock(xa);
> -	return err;
> -}
> -
>  /**
>   * rdma_restrack_init() - initialize and allocate resource tracking
>   * @dev:  IB device
> @@ -226,7 +204,8 @@ static void rdma_restrack_add(struct rdma_restrack_entry *res)
>  	kref_init(&res->kref);
>  	init_completion(&res->comp);
>  	if (res->type != RDMA_RESTRACK_QP)
> -		ret = rt_xa_alloc_cyclic(&rt->xa, &res->id, res, &rt->next_id);
> +		ret = xa_alloc_cyclic(&rt->xa, &res->id, res, xa_limit_32b,
> +				&rt->next_id, GFP_KERNEL);

restrack.c part looks good.
Thanks


>  	else {
>  		/* Special case to ensure that LQPN points to right QP */
>  		struct ib_qp *qp = container_of(res, struct ib_qp, res);

  parent reply	other threads:[~2019-03-11 12:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21  6:13 linux-next: build failure after merge of the xarray tree Stephen Rothwell
2019-02-21 12:34 ` Leon Romanovsky
2019-02-21 12:48   ` Stephen Rothwell
2019-02-21 13:16     ` Leon Romanovsky
2019-02-21 13:23       ` Stephen Rothwell
2019-03-11  2:44   ` Matthew Wilcox
2019-03-11 12:13     ` Jason Gunthorpe
2019-03-11 12:31       ` Matthew Wilcox
2019-03-11 14:12         ` Jason Gunthorpe
2019-03-11 12:46     ` Leon Romanovsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-08  6:55 Stephen Rothwell
2020-10-08 14:09 ` Matthew Wilcox
2020-10-08  6:50 Stephen Rothwell
2019-02-12  5:20 Stephen Rothwell
2019-02-12 16:15 ` Matthew Wilcox
2019-02-12 16:23   ` Jason Gunthorpe
2019-02-13 21:26     ` Matthew Wilcox
2019-02-13 22:09       ` Jason Gunthorpe
2019-02-21 12:47         ` Stephen Rothwell
2019-02-21 17:40           ` Jason Gunthorpe
2018-06-18  3:27 Stephen Rothwell
2018-06-18 16:50 ` Dan Williams
2018-06-18 17:09   ` Matthew Wilcox
2018-06-27  3:09     ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311124630.GG32625@mtr-leonro.mtl.com \
    --to=leonro@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox