Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1085703pxa; Sat, 22 Aug 2020 10:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6LD2mSXkkAB49AchaNHh9aoWwI+ujKoWBr0Yfy0Jn76u7c46M5k5TpG/gOxrFDL/knfz9 X-Received: by 2002:a05:6402:1c10:: with SMTP id ck16mr7934358edb.151.1598117512367; Sat, 22 Aug 2020 10:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598117512; cv=none; d=google.com; s=arc-20160816; b=wTVN1vkkSrIhxB8eKbAuwSDD3VSCkWmjmP2H4ANphxLZoaN/YtJLOGjdMtNxq88q3U QO8K779N5sKQpI9NTLpNrL5LptpWfgfCBjACYIFtPnFBT12jvohexP5vIyR8DYFTCWMR tvToKINeUrSXkppkbpL1qyaFv30DdtBB4CqmvUAM5TOwc+zuWxU1+mrNJ5Z5l/mne8ks f8Ku8qyG1GLHTtr4Ok16RIgtYdiLL86gz3AKD5OiYd51F9wBdELQ1wkYT6BrnbXo8u2B i5bdhHJH61psglyrSggaqPNH0Q1dSd5JnP/uANJQPBnb2Wb18LIU0xkpE9BtpEG5ZH59 JjKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uDk1uTkzBrobW1w/NKB0oMWkQcelQXY/S6aVRrAX0ZA=; b=kQ+SnClMnOfhq6NGmDGgxWnxXUOYUQty4kINnHEC1CaL6mKGOEjB5oo3ecdmjKbeZA 2UtandQvW9I7I/XR54JtFBVrlU+ut6mf27ylVLyF2IlUBeDAnYMkZdF6aAlYvQRJEICk OSpvVVAT0euAP0D2cOziD1SGOaQVc2f/fKGGnv4j42GDO5G9bHNCEM15XsYDKf//n000 uRq2Q7IbSID7Q233UaKBxzPsR5lbhuwlg+y8yH9vju0shhCa/m1n1SUeTT1j32d720Bu +ocG6EVorPxyMlFdEWLl1VvYtaAxihE7Ssm2ejUXYowaN7+HVGl/4g2/n161E3GBcTq1 rBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dyCpYQrx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si3614388ejs.509.2020.08.22.10.31.28; Sat, 22 Aug 2020 10:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dyCpYQrx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728435AbgHVRau (ORCPT + 99 others); Sat, 22 Aug 2020 13:30:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbgHVRas (ORCPT ); Sat, 22 Aug 2020 13:30:48 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C48C061573 for ; Sat, 22 Aug 2020 10:30:48 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id e187so2817408ybc.5 for ; Sat, 22 Aug 2020 10:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uDk1uTkzBrobW1w/NKB0oMWkQcelQXY/S6aVRrAX0ZA=; b=dyCpYQrxZN93H1AZy0Svu15URVWoPeG7t+Bjh405njPSC+q6aqdkS/8H/dJChB+kxX whnTVWTCOFzgZGQ3lqwsivukNlwOwYS10yIBa2iCcpKlqlifHV+hF3o+tpuxP8m1Vez9 tt2xfKXXvTYFk6sNGaCwM5y/XWvyLTsrrXwfBQjtWT2euwkPyLLi2XzVljG7somyHg44 HI4vV/ZXhA6msoH0Uj0HOQdA7SivMo2hPfjMRFq12ND1Qd6I9YI8uPsCTsct6dD1MlSN PSAQdI1+dqSmrDRRhWgDkOkGdCsVYXynn3H1xBiKuC3dsVM5FN/yeh0g7yU6lnIbIa5y YV6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uDk1uTkzBrobW1w/NKB0oMWkQcelQXY/S6aVRrAX0ZA=; b=Zc+7x2zw7Ifl3F5AsCz3Zd6YTc0wQVdJYMzy/GMqI5w/U82XsNNqamvjD69dz0D9Vs oxSRw3n7+Uypo88idakH+K7NKmPodoTxF/EB1B9QWcmWQfYJxVwOaW/4sy9gGe2qVc3P 5ZkzVqBI7HwZGdPJsOTS7hytEwNm8RJNNeAsc9fZOykQneFgATMjcpoKHP1KZrUnqN6z j+sn7coct3bitGq7p/k91Sq3WErMiY+M49kQGJqgPKGzrkUG2JLu51EnyWg4sSwXQ1um GNwYj4UWFn9HlUaNEVw/wkYgTo6Qb4dqcjULZ7Z7hzBnP+hZaSAHmCBsBnzX3+Csrsnx e2ww== X-Gm-Message-State: AOAM530DFcU3AKB6XH52FhbvTYmmntpOebKavoPE/SplRAt1OmH5gU4E f6sYae/EojoqNHHBDzzvaigtGcmdMctFtlnavRA3Aw== X-Received: by 2002:a25:c4c5:: with SMTP id u188mr10605839ybf.162.1598117446875; Sat, 22 Aug 2020 10:30:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Michel Lespinasse Date: Sat, 22 Aug 2020 10:30:34 -0700 Message-ID: Subject: Re: Lockdep question regarding two-level locks To: Peter Zijlstra , Ingo Molnar , Will Deacon , Davidlohr Bueso Cc: LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 22, 2020 at 9:04 AM Michel Lespinasse wrote: > - B's implementation could, when lockdep is enabled, always release > lock A before acquiring lock B. This is not ideal though, since this > would hinder testing of the not-blocked code path in the acquire > sequence. Actually, this may be an acceptable way to handle my issue. In the non-blocking case, B's implementation does not have to actually release A, but it could tell lockdep that it's released A, acquired B and acquired A again. Kinda ugly but should work... -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.