From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D31501C5F39 for ; Wed, 17 Jun 2026 12:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.177.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781698451; cv=none; b=J/HvMJ5azztakwITICiLbDxC2MlpCWyg2OGwBMzQ7x4DaQTVQO/VD+SbCIN3GwDY6zpJS41fV8E83aOSaoiOEpQ1EtDEGWadUkW83ZGNhDUo+SclOk081kfvV2gmcAdKhK3VjSx4vTCB/4BIzlaouT6sS6O/zc2UoDFnKr3HHHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781698451; c=relaxed/simple; bh=sLy5zo2jV8By6FBulMMGIjUv4vGUX6KkjHofPLuYfeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WYqamYkJ8nnQWewLh2fTMRwKlcwASWmrdgE5a5ilai0nh+wYLjL2/sDOrnn8T14beUxMVk3FMDJiehkJMQU7+OsV+1ak6CNKU8It0Wyg8osjTJSLDXkSKzccBZ+J0VIKqPCf63tteUAi0im6YNjKex5szEUNKxuMW4E3Hes3dAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=GA2+gin+; arc=none smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GA2+gin+" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLW3Fo585329; Wed, 17 Jun 2026 12:13:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2025-04-25; bh=UyKTatUjdGYhOAs/StYkkUUbzf9CkbfZLZ9cSms1hqg=; b= GA2+gin+SCZHGXUEDK3JtngOkvwOSoFB2fV+Z/rUjemX7dzeZZrKWmRekQUyPWpC y4W/DkN0jLkieWJry4Pdw1ayuceRw/ozVnSg4+zFLivIO06V83TnNrGjqitIpK4N HaFNx182oHjBMbQhZVaAprB54ZLve+IDxBXjX9K6Q/S/vISyhPNuf+l3i7eoLmSy 8RBR0rFh+uKbz8+BI74Wyn/ztuuPodaehD21LNTtUAhL5MCX1HwkYgeCGfr1pdM3 PqjqHquJ0hTcyJm7I3irK1QarQhfNUVgBc8lAnVspYNulbfVycfgYn2oduVr9KaK Cvyqpj8RuoaXL/NzxQ8Uhg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4euefugt4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jun 2026 12:13:50 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.7/8.18.1.7) with ESMTP id 65HCCuQW031902; Wed, 17 Jun 2026 12:13:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4euduxddru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jun 2026 12:13:49 +0000 (GMT) Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 65HCDfNA034521; Wed, 17 Jun 2026 12:13:49 GMT Received: from lab61.no.oracle.com (lab61.no.oracle.com [10.172.144.82]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4euduxddkt-4; Wed, 17 Jun 2026 12:13:49 +0000 (GMT) From: =?UTF-8?q?H=C3=A5kon=20Bugge?= To: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Waiman Long , Chris Wilson , Guenter Roeck Cc: =?UTF-8?q?H=C3=A5kon=20Bugge?= , Ingo Molnar Subject: [PATCH 3/4] test-ww_mutex: Handle transient -EDEADLK in test_cycle_work Date: Wed, 17 Jun 2026 14:13:32 +0200 Message-ID: <20260617121335.2036954-4-haakon.bugge@oracle.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20260617121335.2036954-1-haakon.bugge@oracle.com> References: <20260617121335.2036954-1-haakon.bugge@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-17_01,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2606150000 definitions=main-2606170116 X-Authority-Analysis: v=2.4 cv=S4XpBosP c=1 sm=1 tr=0 ts=6a328f7e cx=c_pps a=OOZaFjgC48PWsiFpTAqLcw==:117 a=OOZaFjgC48PWsiFpTAqLcw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=M51BFTxLslgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=x4eqshVgHu-cdnggieHk:22 a=yPCof4ZbAAAA:8 a=0Fz71ZYwMHI_va7L3ykA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE3MDExNiBTYWx0ZWRfX8QQET7k/tp01 oKftgg3fgsHeZpa7Qq9CzRRIT0dFrX7O3FVROYL7bHZ53vvy/nGDPRytNemCvESgQ1gMk6VtXl5 P3bKRQNdXjCUViQ9VjnF5ScM7v/KN0yHO118/hvF4VV30+9jNZoT X-Proofpoint-ORIG-GUID: hUcVozVeRgzimjtZbDf9nJ3ZtXsCoVtI X-Proofpoint-GUID: hUcVozVeRgzimjtZbDf9nJ3ZtXsCoVtI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE3MDExNiBTYWx0ZWRfX+amXOAfU0jLt buBqQ8IhzDyAfK/hw4ustOeOGvSco8zyfGtgUgy+6EnYB0xrZm6h6jFAlth2GnzWpEIxubrzWb8 v3y5gvhXvHHE+x17z5J0DxkGdNbw+l8RCycYNPnkPsXmThu62/DZ+YCgslQ6kSInCtO8FIXM4+J FymBwapnwvBO1JXSdQcfItsu7rIyBOphQBqb+eshnaE+yOraqzSFWkjqxhjXoQnhKQLeHrZKxcf N4zhiasVNfHiBeDSP3A4NE0vhcH7GUqbw6DoNH3xeiRpQkpVDbibCPpgBwCT/lHCQd1INcPUkKB 3m13Yc5Kq8DoGNX/3sqa+C8keI4ZVpdr369dHBRQy3nntlJGsU1F4NA/QhIh1KmQQ+8m5bC5KpY Rbl6b+b+y/O09QjOEagq6m4UpBw3yR4tNnvljMONBsMaFSsXbyWIzJgIDSQlh+0avR8RPr2pQkK ij4BejWELMz5ZeKVqeA== There is a timing issue in test_cycle_work(), in the sense that acquiring *a_mutex* after deadlock has been detected on the *b_mutex*, may not succeed immediately. This may lead to false negatives, which shows up in the log as: cyclic deadlock not resolved, ret[77/93] = -35 We fix that by re-trying until the lock is acquired. Fixes: d1b42b800e5d ("locking/ww_mutex: Add kselftests for resolving ww_mutex cyclic deadlocks") Fixes: e4a02ed2aaf4 ("locking/ww_mutex: Fix runtime warning in the WW mutex selftest") Signed-off-by: HÃ¥kon Bugge --- kernel/locking/test-ww_mutex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c index 5a4c92801bdfb..6b29a7a8f5fba 100644 --- a/kernel/locking/test-ww_mutex.c +++ b/kernel/locking/test-ww_mutex.c @@ -306,7 +306,9 @@ static void test_cycle_work(struct work_struct *work) err = 0; ww_mutex_unlock(&cycle->a_mutex); ww_mutex_lock_slow(cycle->b_mutex, &ctx); - erra = ww_mutex_lock(&cycle->a_mutex, &ctx); + do { + erra = ww_mutex_lock(&cycle->a_mutex, &ctx); + } while (erra == -EDEADLK); } if (!err) -- 2.43.5