Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1268725rwb; Tue, 27 Sep 2022 10:32:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hgh++S8BQS4aPAPEo1csDzZaj+kFppp0eBwoWqHVs2b+3Eh+W4YzBwAMTEQ6sBa2RF+F/ X-Received: by 2002:a17:907:70a:b0:741:78ab:dce5 with SMTP id xb10-20020a170907070a00b0074178abdce5mr24162316ejb.527.1664299955492; Tue, 27 Sep 2022 10:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664299955; cv=none; d=google.com; s=arc-20160816; b=vxOq0QPL+cvpqAb4377sYyLiLpEWClmKwslruEACYJpFuo8a8wc90TNTqp5iBC0xfc 40CxBCdU2TpYDhnZu/J/B3A4oZzfloqzt5hImjxGpWN2kQ8Cyq/qkF6WRV+UYs6RDMnN r/kSaSMvm5phPI6qaBAdhkIPlq/vT53tzF7GGewRvWs6A0Btd5FOAhz/wX1W15ZGSOZG 1NQWYHR+dyHVAIUhR3tREhZUvCYOa7zUmVHkDFXegpJIGlsoa9odw0nwa7FkyTdwcDMY 8gCnsyvY5sAsl3VMbc73V1JgfABX+TaWqtpSuCuRiqACh9Bl/+N8lPWA1Q7eSBYMvhAb kNZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ac2sjt3sPFt8RtPvrVtN9tXh8Xt7MywzaP0lExj7Dfo=; b=bHnzOCt4kD6yqeC6qvuxqW1LD42hH0s+OIhu7gMfiEJUBEAhoidUjP9VEX+i3LAtWZ XjdDpUYim3zhMhdAlX5iiOpTL0Q6IUXyCkfeuSfyr55aBVN+TAsgL5mqqvSAa5KT0rG1 DEl04hN1w8S5P00Kscfgk5v7MlcDJNW2/9awB4drRpZM6BLB07u3IJmejUlmCXLRzjDd OUhFSn6wkrdOI66cyvZvaDFWfF3yd878DrIi09bQLX6zoOZ1Sc/kJdGoQwgwNDYpBjrS hw0GFlUkNJN3TjzU8xJSnyktVMu73ygFaEm0NOgJwznfXZBRI0MQ1ZRPPraDkNLNRO8P kcXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ec23-20020a170906b6d700b0073d9c29892csi1824479ejb.939.2022.09.27.10.32.08; Tue, 27 Sep 2022 10:32:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232168AbiI0RLT (ORCPT + 99 others); Tue, 27 Sep 2022 13:11:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbiI0RLO (ORCPT ); Tue, 27 Sep 2022 13:11:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A390FCA7A for ; Tue, 27 Sep 2022 10:11:13 -0700 (PDT) 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 F10CF60CF6 for ; Tue, 27 Sep 2022 17:11:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A9AC433B5; Tue, 27 Sep 2022 17:11:11 +0000 (UTC) Date: Tue, 27 Sep 2022 13:12:21 -0400 From: Steven Rostedt To: Waiman Long Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , linux-kernel@vger.kernel.org Subject: Re: [Resend PATCH v2] tracing: Disable interrupt or preemption before acquiring arch_spinlock_t Message-ID: <20220927131221.1b3a736b@gandalf.local.home> In-Reply-To: <9c798af6-aa2c-5f76-7a50-ef1983f9bdcd@redhat.com> References: <20220922133158.1731333-1-longman@redhat.com> <20220922145622.1744826-1-longman@redhat.com> <9c798af6-aa2c-5f76-7a50-ef1983f9bdcd@redhat.com> 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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Sep 2022 11:28:13 -0400 Waiman Long wrote: > On 9/22/22 10:56, Waiman Long wrote: > > It was found that some tracing functions in kernel/trace/trace.c acquire > > an arch_spinlock_t with preemption and irqs enabled. An example is the > > tracing_saved_cmdlines_size_read() function which intermittently causes > > a "BUG: using smp_processor_id() in preemptible" warning when the LTP > > read_all_proc test is run. > > > > That can be problematic in case preemption happens after acquiring the > > lock. Add the necessary preemption or interrupt disabling code in the > > appropriate places before acquiring an arch_spinlock_t. > > > > The convention here is to disable preemption for trace_cmdline_lock and > > interupt for max_lock. > > > > Fixes: a35873a0993b ("tracing: Add conditional snapshot") > > Fixes: 939c7a4f04fc ("tracing: Introduce saved_cmdlines_size file") > > Suggested-by: Steven Rostedt > > Signed-off-by: Waiman Long > > --- > > kernel/trace/trace.c | 23 +++++++++++++++++++++++ > > 1 file changed, 23 insertions(+) > > Ping! > > Any comment on this patch? You may have noticed (from today's emailing) I applied the patch ;-) -- Steve