public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>,
	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 22:13:16 -0500	[thread overview]
Message-ID: <6296dc52-1298-6a52-a4fb-2c6fe04ab151@gmail.com> (raw)
In-Reply-To: <ec1de70c-aa84-7c3a-af6c-4a04c5002d1e@acm.org>

On 4/10/22 22:06, Bart Van Assche wrote:
> 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.

You're right. I missed that. Zhu wants to write the patch so hopefully he's on top of that.
For now we could use GFP_ATOMIC.

Bob

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

Thread overview: 5+ 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
2022-04-11  3:13   ` Bob Pearson [this message]
2022-04-11 11:38     ` Jason Gunthorpe
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=6296dc52-1298-6a52-a4fb-2c6fe04ab151@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --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