lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2b593684-4409-485b-9edf-e44a402ecf3a@linux.dev>
Date: Mon, 11 Aug 2025 06:48:59 -0700
From: Zhu Yanjun <yanjun.zhu@...ux.dev>
To: Philipp Reisner <philipp.reisner@...bit.com>,
 Daisuke Matsuda <matsuda-daisuke@...itsu.com>
Cc: Zhu Yanjun <zyjzyj2000@...il.com>, Jason Gunthorpe <jgg@...pe.ca>,
 Leon Romanovsky <leon@...nel.org>, linux-rdma@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rdma_rxe: call comp_handler without holding cq->cq_lock

在 2025/8/10 22:26, Philipp Reisner 写道:
> On Thu, Aug 7, 2025 at 3:09 AM Zhu Yanjun <yanjun.zhu@...ux.dev> wrote:
>>
>> 在 2025/8/6 5:39, Philipp Reisner 写道:
>>> Allow the comp_handler callback implementation to call ib_poll_cq().
>>> A call to ib_poll_cq() calls rxe_poll_cq() with the rdma_rxe driver.
>>> And rxe_poll_cq() locks cq->cq_lock. That leads to a spinlock deadlock.
>>>
>>> The Mellanox and Intel drivers allow a comp_handler callback
>>> implementation to call ib_poll_cq().
>>>
>>> Avoid the deadlock by calling the comp_handler callback without
>>> holding cq->cw_lock.
>>>
>>> Signed-off-by: Philipp Reisner <philipp.reisner@...bit.com>
>>
>> ERROR: test_resize_cq (tests.test_cq.CQTest.test_resize_cq)
>> Test resize CQ, start with specific value and then increase and decrease
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>     File "/root/deb/rdma-core/tests/test_cq.py", line 135, in test_resize_cq
>>       u.poll_cq(self.client.cq)
>>     File "/root/deb/rdma-core/tests/utils.py", line 687, in poll_cq
>>       wcs = _poll_cq(cq, count, data)
>>             ^^^^^^^^^^^^^^^^^^^^^^^^^
>>     File "/root/deb/rdma-core/tests/utils.py", line 669, in _poll_cq
>>       raise PyverbsError(f'Got timeout on polling ({count} CQEs remaining)')
>> pyverbs.pyverbs_error.PyverbsError: Got timeout on polling (1 CQEs
>> remaining)
>>
>> After I applied your patch in kervel v6.16, I got the above errors.
>>
>> Zhu Yanjun
>>
> 
> Hello Zhu,
> 
> When I run the test_resize_cq test in a loop (100 runs each) on the
> original code and with my patch, I get about the same failure rate.

Add Daisuke Matsuda

If I remember it correctly, when Daisuke and I discussed ODP patches, we 
both made tests with rxe, from our tests results, it seems that this 
test_resize_cq error does not occur.

Yanjun.Zhu

> 
> without my patch success=87 failure=13
> without my patch success=82 failure=18
> without my patch success=81 failure=19
> with my patch    success=89 failure=11
> with my patch    success=90 failure=10
> with my patch    success=82 failure=18
> 
> The patch I am proposing does not change the failure rate of this test.
> 
> Best regards,
>   Philipp
> 
> #!/bin/bash
> 
> success=0
> failure=0
> 
> for (( i = 0; i < 100; i++ )) do
>        if rdma-core/build/bin/run_tests.py -k test_resize_cq; then
>    success=$((success+1))
>        else
>    failure=$((failure+1))
>        fi
> done
> echo success=$success failure=$failure


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ