Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2801938pxv; Mon, 12 Jul 2021 02:10:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKXO0R3YAMdxCbqLzcGruEyoejCVyS5g5v/s++73G5wIueba+CP423FhygPqzZPZk/Pzom X-Received: by 2002:a17:906:4e52:: with SMTP id g18mr31543236ejw.214.1626081013176; Mon, 12 Jul 2021 02:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626081013; cv=none; d=google.com; s=arc-20160816; b=shU+H1jGWk7C27xNibEsO+anveCggo1xRpekzqdmniixrKgAC1kovvjLXySJaNkHn2 9C4CTX3Z3gkOzFftoJp+PgMhXgA0ctWGP7+y6hpiqPZ3CV6vfyMXzEpggDgBbe5+iaXR Gu6kYJv9N+ii9OV7/d9tF1/7e6r/5adpI0x3H6DMOmfAM2JcWIXM7u6IeXW1dm1DIldK s3hphxSagsNd48cRF/DDJrKr1Tj6x1rwRhzJTpsfaxcjI7nD4Fhk4udSBpOHNVP/K1Sm 4LildU5rRRwy0AhVg9ufh7G91M3MlA4y+PwxhCEB3OFibV0iebss6yZx0qXymMRw2i0y BvZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gr5RwC6zTNVzz2t2qLDZNHNhS8++ncXvIVfc8T4BQKw=; b=Xgd5qYmku4YBmlA3nH0oKoert04xDzxV0SIAxb0QqR6kRXyW+gxuyIFTKWTKlgxXh+ v1UjtUoIGTFOyjntMp7MC4LCV+f5uxlgSTZiQnUPJgMXkTPiWFI9wZKqvq+0ePF68Rn9 ojvy77xOFJfnDlzEKQ5MKk5q2GU5Ou2QCKmO4LB0wEvN8m5QT7oVzpBwN/0gWuRddI/v M6AjFmm75wJ5dNJBVjB1MZBjgALA5bQJrR3gkPqNESCvGOaNRqslvL9ADajjUqUWG9T4 LgQ1gVBs4n9b4QmdkQLpS4n9B6WIJUobO6CAtiFWLc/StVlbkXYjiyPe0pYP8JT4hIn8 q/PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=swJ87Q9g; 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 js9si1038965ejc.433.2021.07.12.02.09.49; Mon, 12 Jul 2021 02:10:13 -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=swJ87Q9g; 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 S1385004AbhGLJJw (ORCPT + 99 others); Mon, 12 Jul 2021 05:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382110AbhGLJAb (ORCPT ); Mon, 12 Jul 2021 05:00:31 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E502EC0617A7 for ; Mon, 12 Jul 2021 01:52:20 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id s6so14376523qkc.8 for ; Mon, 12 Jul 2021 01:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gr5RwC6zTNVzz2t2qLDZNHNhS8++ncXvIVfc8T4BQKw=; b=swJ87Q9gFWn9AJRRt20yb/p5k7hDgEvS+K57GUEsjNrmAOODI7HIMfs4fq2Pf6TJhI O+LzphEojHWKcorplpOsLraa2aE3o2HYM+XOIj8KL14q1drqptieUl7luAMIeyz1xm0d tCw1hKR4CnRObeatq95PM5ZX2Bgdg5npo6qe6nRtPk9zS+j+Nh9oyOzi/NOIzKzKI9vj sY2eN6Tq6YwSqZtgz7b4tfJPzDizkeZNV4R4oYTKT1hcOulATG3luTNyKcNSdItJ88px gns5L0HyrA+i7jiP3HTcMe6RO7F2mp4E5sKfCe/24zJHEw9xFTvkNfB9MiTRlRmms+uT MpyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gr5RwC6zTNVzz2t2qLDZNHNhS8++ncXvIVfc8T4BQKw=; b=OKsxFUsTtK2qgmSSwSi4cHaM89XJQREWrs9Jc8V/r8phyXWFeNinV0O9HAHaVb4aBd 8Fky2+b5/Fq/HJ17gFbuCayZ8bEOK65YSL+mrACcQcDnDXMqobLJuhTxFL5sskTCqPQX nVTD1wbYSvJz95TzWS7B5+Cc/n3j/p54Zbw6Jy7VJRCLbdI9Oo7UStVeyPCmRxlRcnzT Ph1DvsuHCF15YwPQLh99Y3LuOdY1kdWxrxofuYfoY1iNIZu24LdSJWpcx4wkQieIu1X+ d+3Nz79Hx3fJ/zaD6P6uKiq3Bbt90IW+0QTnl9gAmI9h2Ry3WrPAfE6AHNN6ALv6qaYs a6bQ== X-Gm-Message-State: AOAM533BNLAMOzgE3FxrzPB6UaJCyXqaHb5zitmbHL9nA6EqG962x1TY ARLQyWqRBrwa6SakCgvqEcs= X-Received: by 2002:a05:620a:142d:: with SMTP id k13mr33216765qkj.48.1626079940164; Mon, 12 Jul 2021 01:52:20 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id p9sm5363507qtw.88.2021.07.12.01.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 01:52:19 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 39D3927C005B; Mon, 12 Jul 2021 04:52:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 12 Jul 2021 04:52:19 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeegudffjeelvddtgfejleekffeufeekkeehgeelkeetveeiieetteefheetvefh feenucffohhmrghinheplhifnhdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshho nhgrlhhithihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngh eppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 12 Jul 2021 04:52:17 -0400 (EDT) Date: Mon, 12 Jul 2021 16:50:44 +0800 From: Boqun Feng To: Xiongwei Song Cc: Waiman Long , Xiongwei Song , peterz@infradead.org, mingo@redhat.com, will@kernel.org, Linux Kernel Mailing List Subject: Re: [RFC PATCH v1 1/3] locking/lockdep: Fix false warning of check_wait_context() Message-ID: References: <20210711141430.896595-1-sxwjean@me.com> <07878d21-fa4d-fbf5-a292-b71c48847a5e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 > >