Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Bob Pearson <rpearsonhpe@gmail.com>,
	jgg@nvidia.com, zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org,
	linux-scsi@vger.kernel.org, yi.zhang@redhat.com
Subject: Re: [PATCH for-next] RDMA/rxe: Fix "Replace red-black trees by xarrays"
Date: Sun, 10 Apr 2022 20:06:31 -0700	[thread overview]
Message-ID: <ec1de70c-aa84-7c3a-af6c-4a04c5002d1e@acm.org> (raw)
In-Reply-To: <20220410223939.3769-1-rpearsonhpe@gmail.com>

On 4/10/22 15:39, Bob Pearson wrote:
> Fixes: 3225717f6dfa ("RDMA/rxe: Replace red-black trees by carrays")
                                                              ^^^^^^^
                                                              xarrays?

> @@ -138,8 +140,10 @@ void *rxe_alloc(struct rxe_pool *pool)
>   	elem->obj = obj;
>   	kref_init(&elem->ref_cnt);
>   
> -	err = xa_alloc_cyclic(&pool->xa, &elem->index, elem, pool->limit,
> +	xa_lock_irqsave(xa, flags);
> +	err = __xa_alloc_cyclic(&pool->xa, &elem->index, elem, pool->limit,
>   			      &pool->next, GFP_KERNEL);
> +	xa_unlock_irqrestore(xa, flags);

Please take a look at the xas_unlock_type() and xas_lock_type() calls in 
__xas_nomem(). I think that the above change will trigger a GFP_KERNEL 
allocation with interrupts disabled. My understanding is that GFP_KERNEL 
allocations may sleep and hence that the above code may cause 
__xas_nomem() to sleep with interrupts disabled. I don't think that is 
allowed.

Thanks,

Bart.

  reply	other threads:[~2022-04-11  3:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 22:39 [PATCH for-next] RDMA/rxe: Fix "Replace red-black trees by xarrays" Bob Pearson
2022-04-11  3:06 ` Bart Van Assche [this message]
2022-04-11  3:13   ` Bob Pearson
2022-04-11 11:38     ` Jason Gunthorpe
2022-04-11 15:52       ` Pearson, Robert B
2022-04-11 16:02         ` Jason Gunthorpe
2022-04-12 13:32           ` Yanjun Zhu
2022-04-12 13:39             ` Jason Gunthorpe
2022-04-12 13:49               ` Yanjun Zhu
2022-04-11  3:15   ` Zhu Yanjun

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=ec1de70c-aa84-7c3a-af6c-4a04c5002d1e@acm.org \
    --to=bvanassche@acm.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rpearsonhpe@gmail.com \
    --cc=yi.zhang@redhat.com \
    --cc=zyjzyj2000@gmail.com \
    /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