Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2799375pxv; Mon, 12 Jul 2021 02:06:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXOwUDGPP/R1dVysneNZ/ALITgrbukCWEJuS9NaczExxrHzTSqjQbzcZOBXuChnM+aX324 X-Received: by 2002:a05:6602:3404:: with SMTP id n4mr19593162ioz.19.1626080780556; Mon, 12 Jul 2021 02:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626080780; cv=none; d=google.com; s=arc-20160816; b=sDlJZ3DGnCxd/Zy0pS3BcH0qY9eJkRLK+kvEbXW0bYdXlU/sWQBryEpjVmUmqE2mn9 oqmE6hkviE5gB/mRze9x5YaFRklUDMirVVt6ms6GPuW31k/E9vxvhBtxIFjprjGhG/ky vndWkl42aJI/TtxzVsKXTWiM5rhX/T8685C69G/fVL3uzy6SC8VCDtLyM8xsuSVoBRUY U49zUQW50oXcSEEuf5Ndd6IYcNod/7sXR7EqQ4x1GqxUZywsgNIVsVNM8eV+0tj3MvRL 3BBvGzl+ATV4pnJeeEQWaQ30ooQkOOHpWJs2Bxfw4RHGZowKQu0DTz+n2+zf+iQDg7m0 4waQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4Vqms0vy9lHt4dorTNB1riLmavTf8tDwGAT9NwU4T/8=; b=bBnet8pwQ6c1s0aA7gaw3nOmPMzWi+SLRBSkrcGjlHJhmTDIsHX7EUSvoLSxU/+RpO C/lliORPKaUilOaKmGNnJqYKT8VSYJO4Bi4IUl7BgdCu/9OuSEuWerqEjK0Lb6GUQK8T R7lQfY90sNnv1J3v4fYtdIN5tZz3dlQ1uonHTwYV7E0ZTCD3iyLLzevfZBAmIoueHpfe 742Jb13LcVjRiSq4A/rGstpyMsQb+p0FIxY7Z4eEs0l8MwImcrg0EhXpb9q5DdKuwM9w 0XCszzwSxRC61t+KmgTI6BqSUkLeFf7fa7vgqU8XghaYpktZSP3GKmUu4aa5JdcCmAIk rNCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PtrvR9Kd; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si18771667iov.63.2021.07.12.02.06.08; Mon, 12 Jul 2021 02:06:20 -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=@gmail.com header.s=20161025 header.b=PtrvR9Kd; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357244AbhGLJHD (ORCPT + 99 others); Mon, 12 Jul 2021 05:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358999AbhGLI0Y (ORCPT ); Mon, 12 Jul 2021 04:26:24 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F528C00666B for ; Mon, 12 Jul 2021 01:19:04 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id e20so22793865ljn.8 for ; Mon, 12 Jul 2021 01:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Vqms0vy9lHt4dorTNB1riLmavTf8tDwGAT9NwU4T/8=; b=PtrvR9Kd0oTwy1FIWXsIc9PflVmbJ33VfTS6zTYe8usXpRn2Oz6qIfuiLoFkhlU3yN LGekOUjbPkeZ1EBicgj3xxbRuzaXwKPnQj+hvYd4ouV7COrE68LoWNxb3+MnqY2ne/UZ a+cmirTHV5hmfTmTy3jcSn+azCOGBiNVLcOsub2VH5im/uKMQMP7ngGProM6mt0m9/IU K/jawWf2oSsqcxlxyHkmtO5GPgoUPSXwmZHnegYVSHXZ9jKh4ZOA9xqDBdPAq02QfrI9 fSV5NOZfD9krCwPQDkhw8jj4O7y3ZVcOHhCd6L8W+cb4nLeSGjs65cspOaHnNXFBx/0G qqog== 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=4Vqms0vy9lHt4dorTNB1riLmavTf8tDwGAT9NwU4T/8=; b=awyqJMv/iKNrNAuWeq37RGAclt06LOHrMDpqKBmSAeWirzANwHDb9Vj7RNAJd8iObg EaeFDeqF3058hI0iaBacc/Vxbdc3vd89MIsKT3ggTj1bD7YuNKsYTeaRnjghjlbSSEH3 VHR1X/yTUIrjnKlyREF1gRE8/zoStMRpZSKOvXBbSUNq+etLoSQlw1RnnG1cfgASWPmJ bbFjmBuPvjEz5vy4V+9wCvcR+YP43zXp7aRlUFVpBxU9twCXAdfYrdiHTRl5yAziwyAb EQD8WnYLXNKy6I6123IqkvtSUwEr3nxTb5apWWxbD24c0eBBy2UlsS3D2n0IjZ0jAjGD nQ7A== X-Gm-Message-State: AOAM5312SCOpm+T6Kg8kOxrEU7lJvp25issC44bx5X0HUNeiLaeR5La8 PDFvyTIshoD3e3ufAiK9IJBecNBOAmpy9qAK4k4= X-Received: by 2002:a2e:a596:: with SMTP id m22mr12809050ljp.86.1626077942658; Mon, 12 Jul 2021 01:19:02 -0700 (PDT) MIME-Version: 1.0 References: <20210711141430.896595-1-sxwjean@me.com> <07878d21-fa4d-fbf5-a292-b71c48847a5e@redhat.com> In-Reply-To: <07878d21-fa4d-fbf5-a292-b71c48847a5e@redhat.com> From: Xiongwei Song Date: Mon, 12 Jul 2021 16:18:36 +0800 Message-ID: Subject: Re: [RFC PATCH v1 1/3] locking/lockdep: Fix false warning of check_wait_context() To: Waiman Long Cc: Xiongwei Song , peterz@infradead.org, mingo@redhat.com, will@kernel.org, Boqun Feng , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 12, 2021 at 12:43 AM Waiman Long wrote: > > On 7/11/21 10:14 AM, Xiongwei Song wrote: > > From: Xiongwei Song > > > > We now always get a "Invalid wait context" warning with > > CONFIG_PROVE_RAW_LOCK_NESTING=y, see the full warning below: > > > > [ 0.705900] ============================= > > [ 0.706002] [ BUG: Invalid wait context ] > > [ 0.706180] 5.13.0+ #4 Not tainted > > [ 0.706349] ----------------------------- > > I believe the purpose of CONFIG_PROVE_RAW_LOCK_NESTING is experimental > and it is turned off by default. Turning it on can cause problem as > shown in your lockdep splat. Limiting it to just PREEMPT_RT will defeat > its purpose to find potential spinlock nesting problem in non-PREEMPT_RT > kernel. As far as I know, a spinlock can nest another spinlock. In non-PREEMPT_RT kernel spin_lock and raw_spin_lock are same , so here acquiring a spin_lock in hardirq context is acceptable, the warning is not needed. My knowledge on this is not enough, Will dig into this. > The point is to fix the issue found, Agree. I thought there was a spinlock usage issue, but by checking deactivate_slab context, looks like the spinlock usage is well. Maybe I'm missing something? > not hiding it from appearing. I'm not trying to hiding it, according to the code context, the fix is reasonable from my point of view. Let me check again. Thank you for the comments. Regards, Xiongwei > > Cheers, > Longman >