From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.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 AAF0A1C5F39 for ; Wed, 17 Jun 2026 12:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781698446; cv=none; b=WQqUQAUhTIO/5rG1DC6TzWIHHXnWNiWIlg4MIz+s+KrQO8Q7Bi9KrauANUkuiu4n1vdZNaGm/EZaIi7oRztKkoQ7z8zwxPA5MspxO8K+36T4hSzxcV2ITxOAv0KXWpof4kYAajvYQ4cNLWva0L2PxaOqhSt/hb6/35PQZjs2vLg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781698446; c=relaxed/simple; bh=5GpYZ1zaxizJnstax178yiLwvbnEbcLe0i8jPtXpuSA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PP36SpQaWzK3rYcslPhgL1uiaF3/veojplh6cWT1ePuib8PJB/cNU9eQu8w3++fVmK+kKaTCN5XvAtVM7S9OT84tejDRlycQ8+QidXCxfdfo8SX8LLG77vEcMg/HfDOl5/zYEL6renUR3ORQlhgaFNKbkqHgVRwH8A4cBzrpYXM= 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=grCuJAth; arc=none smtp.client-ip=205.220.165.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="grCuJAth" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GLWGrg688047; Wed, 17 Jun 2026 12:13:56 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=Fm1SgNuDcN9f30r95XbPAQVEHFSplAQJtrMzaUxEUEA=; b= grCuJAthh3Y50oaKJngCE2/E72S1pHNmWHyyu7maxPE3TyQIGFsQsjs60730WK/Y 4hMVDssAkIXz9v0hmCRHKNuSP2VIaQsPOsyMHHsAkWkXdbhaGSlgdpb7Hk3sOW0l E0H1qJYIyHtJsEeCpA8DYbOA5qxGVQLxgY9dh3RzNVWrjZAsJsfWv/yvnVnJ/NiO oI7e4DxrIwHO8XUPmaeTBo3NEUI3T0STD4DFJoDxGsSct2NsgjpGwIgpWcLRzViB LPaRNOr+WgCeBdJbjOFgtlWtDmYAPz4BjLAAJ1bON2BAQHkKPlkdns7N25iuejcL LCDhl2k1q3TDIRyLTMlW2w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4eueg2guem-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jun 2026 12:13:55 +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 65HCCulg031913; Wed, 17 Jun 2026 12:13:55 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4euduxddux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jun 2026 12:13:54 +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 65HCDfNC034521; Wed, 17 Jun 2026 12:13:54 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-5; Wed, 17 Jun 2026 12:13:54 +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 , John Stultz Cc: =?UTF-8?q?H=C3=A5kon=20Bugge?= , Ingo Molnar Subject: [PATCH 4/4] test-ww_mutex: Retry lock acquisition after timeout if deadlocked Date: Wed, 17 Jun 2026 14:13:33 +0200 Message-ID: <20260617121335.2036954-5-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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE3MDExNiBTYWx0ZWRfXz47OpQKRsZXT gByWPWHZ+Qg9Y5iB37wD0O3v33+1+Wp09NeiXKJSKwnTQhsCHGE+AuG02MXVe9IsKnsVh46csi1 XNT7LmOn1ULpjYkw8riCqqaFGrsxuYsjziZMJbllR3RbKcl5WzR7+RLHguygkBSGM/RermyoX7N ld2ej+xEDJPyLPHcYtmJtUcPDHXFnRdJNVymWsKZzmod/fjJrUBL+MJ67wPu3aU8qqtrd8kCXFt lfOJXyMgiIFe5YYJYKQdG0PcqbbVLNCmqWNeUE35NXkTwxWG7XRi+1H1sa2iLYDSvFNneuSI2aA uWljlX389nZJu8tOBuzckbDighCjTWyQtYxB9KNfAee6dtWDImOVxFTH2C58NkVPsxDnWXtS+rh puuODcsjXF8c6aKjJ/K9YiEWZb5BLuIf4gGlXh8pqdeWUDWjthN3JODzDfihTHLCfAJs7ivuF9g x/WMf/c3SHH09FnIT5Q== X-Proofpoint-GUID: PfgD_EqMupWjHE-LBv7aDIoeAOn9lBl6 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE3MDExNiBTYWx0ZWRfX6Sb1NBId8pTr QE4y8+QdyAKQAmCzvHyqYDZ5onuHUOIizI3ZjGo7ahJNibbCjX2lRKsoel0XXhQCOxv8orwDMvW LWhhvamKfUCu94b5jQE7h0OGv/Iy5wKLx3SUA6HQAHiSLJsTvtsO X-Proofpoint-ORIG-GUID: PfgD_EqMupWjHE-LBv7aDIoeAOn9lBl6 X-Authority-Analysis: v=2.4 cv=UY1hjqSN c=1 sm=1 tr=0 ts=6a328f83 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=x0eKOSpe3m1H3M0S9YoZ:22 a=yPCof4ZbAAAA:8 a=JFmy-WnrOQvBsJnkivQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 stress_inorder_work() terminates when its timeout expires. If the final lock acquisition attempt returns -EDEADLK at that point, the test may report a false failure even though the deadlock would have been resolved shortly thereafter. Retry a limited number of times after timeout before reporting failure. Without this commit, we may see in the log: Beginning ww (wound) mutex selftests stress (stress_inorder_work) failed with -35 Fixes: cfa92b6d5207 ("locking/ww_mutex/test: Make sure we bail out instead of livelock") Signed-off-by: HÃ¥kon Bugge --- kernel/locking/test-ww_mutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/test-ww_mutex.c b/kernel/locking/test-ww_mutex.c index 6b29a7a8f5fba..95de03179eac0 100644 --- a/kernel/locking/test-ww_mutex.c +++ b/kernel/locking/test-ww_mutex.c @@ -444,6 +444,7 @@ static void stress_inorder_work(struct work_struct *work) struct ww_acquire_ctx ctx; int *order; int err; + int attempts_after_tmout = 10000; stress->result = -ENOMEM; @@ -476,7 +477,7 @@ static void stress_inorder_work(struct work_struct *work) ww_mutex_unlock(&locks[order[n]]); if (err == -EDEADLK) { - if (!time_after(jiffies, stress->timeout)) { + if ((!time_after(jiffies, stress->timeout)) || attempts_after_tmout--) { ww_mutex_lock_slow(&locks[order[contended]], &ctx); goto retry; } -- 2.43.5