Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2810576pxv; Mon, 12 Jul 2021 02:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwHjZp1ICa3BPD2NwgREdTp+5pBxEpZiShq3+l2nEMooy+3jByYJ20nTyN7sYgvz2l7J1J X-Received: by 2002:a17:906:c30c:: with SMTP id s12mr18011190ejz.476.1626081904828; Mon, 12 Jul 2021 02:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626081904; cv=none; d=google.com; s=arc-20160816; b=wWX113pFFh8IhwWT2WDNuaJoeMC52to7AiCcEgpLYi0hTOhZYuwWdivP8KWlxgbd+t NMJZTGIFAFRqtU9nT6YLOgVC3r2tEC41uNYlhqiV+5eK42pMxB+9C8khiR4bpkbxLtvK cF5Gj2wvaSUzIat6mvCahqlwQliD/Cq38BmFf12GGOEHNoxuFM2IuwIeXWGtZrAL6cI7 w9VDn1IM3uVmcQ89z/lR6is4REfmc9oeLyrTwwHVVaPQ3Mc8kw+EN1id/Z5hTi2rTkYk JgcEfzM3C+Qcv+GkwZfJoKbZHl1EFGc7pm6JSu3U4CoptLpZgNxK40bpiIe4PIsae5kV EmDw== 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=SdCMjlTcF6q8FHXqqR5CiNahO//ITPUe6gTB47ibCWA=; b=FYfRHQmXjcBOZ6K/BDEX1uTTvC9BGaEzk5t9wkf8evd1+oAiiaLmnmt6nDQG6Y8b6v OBREhBhv7cpdLmxASLkOSSmECMi+B/Av5hx0HZMPx0jbWeZKmO78Abf7HyCe2HT3RM0L TY1+RbT7r+WWH85z6o51IVDumhxGMqedecr072ij/itAtY1aXFyNU82mlyol7eTK0WZ1 iwdyj51n8XRP4JPiO/sv60469eTEiJ57j2BTkKApPurKIuwkX8TNpn5mRoZ3XLQsaK5l YvBdn28bEQIL/u0XZUZ7Tdo1cOjrSztNa5LrxmnkRtMoVz3ZbQmWIkMhKvkPPosgKWhG uZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DsAAg+jC; 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 a1si6440921edv.415.2021.07.12.02.24.42; Mon, 12 Jul 2021 02:25:04 -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=DsAAg+jC; 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 S232158AbhGLJ0i (ORCPT + 99 others); Mon, 12 Jul 2021 05:26:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387051AbhGLJZU (ORCPT ); Mon, 12 Jul 2021 05:25:20 -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 C0C3AC0613BA for ; Mon, 12 Jul 2021 02:22:10 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 141so6556434ljj.2 for ; Mon, 12 Jul 2021 02:22:10 -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=SdCMjlTcF6q8FHXqqR5CiNahO//ITPUe6gTB47ibCWA=; b=DsAAg+jCAjWAvEhGNy0CU8HO4iKUo6Iuvt0v/FGWYq7JG9KQVbVuNKVo/wZB4pguhb /jrGLDguS7oSPzDmDV+oF9xV/oz6+//mCymKwSCDxHKgq0RCGQdJjF4AtlNPdY4/J2em jpTE17S+lurHZrTw3plR2LeRsavlDs4/FsTg6FKjApA7mu/U1yLbPsteAou/p3H3gf5E c24nDEjv2lswR7dMIZN94WPIAacqx8BFBi9r75I9xGSDgxKZrmIT2733fiJLug0WTmXN /+8dm2EHD5LO5i8PVfgBPykNfrjHURWLCsjldoM65Ev7ZF9FFCckyY3PQugJsej8d1gm 97iw== 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=SdCMjlTcF6q8FHXqqR5CiNahO//ITPUe6gTB47ibCWA=; b=UblzGKUhOYrd04/tcbH9sD7mZ8yGUVD1HoIaqiagDahwPPbgRh9UBsnR7l8OdoNxDc ruisCeM6NfLPHe2k6xgkJ2nlXHOKOzHPoQtnH3MsKinfiE0v7V8qkOSIBrASDLsOjBQi U66wusnGlyFRB5ddOgFAmW4inyjOov7IXkvaC51lUVXHdSplmV5ZgKbpa/CSTwxj0y9U sso1ARHE1xZ2nsLgY4sIrN/a3y11u4ttLcDaUbrCfezbm8j3/OJ9oLf2U9wXp1YFN3rX 1NaZ/EwuPPp6orYP+FLXI6HaCn6J2OzvMtfNjlmwQrDunv60TOVQTuAu351Be17zeLcn MBbQ== X-Gm-Message-State: AOAM533/jzyc8Po6PAqR8Z4gsvNaOSdDkIiL868wIrmSHGEdwvphl3Ih u0aVyCnhcLgN0TW0YSdZp9CcN3TVxZR5xdiDqXM= X-Received: by 2002:a2e:8247:: with SMTP id j7mr5162627ljh.495.1626081729208; Mon, 12 Jul 2021 02:22:09 -0700 (PDT) MIME-Version: 1.0 References: <20210711141430.896595-1-sxwjean@me.com> <07878d21-fa4d-fbf5-a292-b71c48847a5e@redhat.com> In-Reply-To: From: Xiongwei Song Date: Mon, 12 Jul 2021 17:21:43 +0800 Message-ID: Subject: Re: [RFC PATCH v1 1/3] locking/lockdep: Fix false warning of check_wait_context() To: Boqun Feng Cc: Waiman Long , Xiongwei Song , peterz@infradead.org, mingo@redhat.com, will@kernel.org, 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 4:52 PM Boqun Feng wrote: > > On Mon, Jul 12, 2021 at 04:18:36PM +0800, Xiongwei Song wrote: > > 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. > > > > You may find this useful: https://lwn.net/Articles/146861/ ;-) > > The thing is that most of the irq handlers will run in process contexts > in PREEMPT_RT kernel (threaded irq), while the rest continues to run in > hardirq contexts. spinlock_t is allowed int threaded irqs but not in > hardirq contexts for PREEMPT_RT, because spinlock_t will become > sleeplable locks. Exactly. I think I have known why the fix is incorrect. Regards, Xiongwei > > Regards, > Boqun > > > > 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 > > >