From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 279C4C433F5 for ; Tue, 8 Feb 2022 19:38:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386173AbiBHTiT (ORCPT ); Tue, 8 Feb 2022 14:38:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353785AbiBHTiR (ORCPT ); Tue, 8 Feb 2022 14:38:17 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD87C0613CB for ; Tue, 8 Feb 2022 11:38:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 42ACA615A2 for ; Tue, 8 Feb 2022 19:38:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C622C004E1; Tue, 8 Feb 2022 19:38:14 +0000 (UTC) Date: Tue, 8 Feb 2022 14:38:12 -0500 From: Steven Rostedt To: Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , LKML , Thomas Gleixner , Byungchul Park , "Paul E. McKenney" , Mathieu Desnoyers , Radoslaw Burny , Tejun Heo , Lai Jiangshan Subject: Re: [PATCH 04/12] workqueue: Protect lockdep functions with #ifdef Message-ID: <20220208143812.01f03686@gandalf.local.home> In-Reply-To: <20220208184208.79303-5-namhyung@kernel.org> References: <20220208184208.79303-1-namhyung@kernel.org> <20220208184208.79303-5-namhyung@kernel.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Feb 2022 10:42:00 -0800 Namhyung Kim wrote: > With upcoming lock tracepoints config, it'd define some of lockdep > functions without enabling CONFIG_LOCKDEP actually. The existing code > assumes those functions will be removed by the preprocessor but it's > not the case anymore. Let's protect the code with #ifdef's explicitly. > > Cc: Tejun Heo > Cc: Lai Jiangshan > Signed-off-by: Namhyung Kim > --- > kernel/workqueue.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/kernel/workqueue.c b/kernel/workqueue.c > index 33f1106b4f99..405e27385f74 100644 > --- a/kernel/workqueue.c > +++ b/kernel/workqueue.c > @@ -2279,8 +2279,11 @@ __acquires(&pool->lock) > > raw_spin_unlock_irq(&pool->lock); > > +#ifdef CONFIG_LOCKDEP > lock_map_acquire(&pwq->wq->lockdep_map); > lock_map_acquire(&lockdep_map); > +#endif Same here: lock_map_acquire_raw() ? That is always a nop when CONFIG_LOCKDEP is not set. -- Steve